♻️ Restructure: Move Astro to repository root

BREAKING CHANGE: Astro project is now at repository root
- Removed dealplustech-astro subdirectory
- Moved all Astro files to root
- Updated PostCSS config to .cjs
- Removed old Next.js files

 11 pages built successfully
 Cookie consent banner included
 Privacy/Terms links in footer
 Ready for Easypanel deployment (no root dir needed)

Migration path:
- Old structure: /dealplustech-astro/
- New structure: / (root)
This commit is contained in:
Kunthawat Greethong
2026-03-09 22:00:05 +07:00
parent 5b041a6a44
commit 7a67f68d9f
16524 changed files with 4277 additions and 1983574 deletions

View File

@@ -1,57 +0,0 @@
import * as fs from "node:fs";
import path from "node:path";
import { appendForwardSlash } from "@astrojs/internal-helpers/path";
import colors from "piccolore";
import { notFoundTemplate, subpathNotUsedTemplate } from "../template/4xx.js";
import { writeHtmlResponse } from "./response.js";
function baseMiddleware(settings, logger) {
const { config } = settings;
const base = config.base || "/";
const site = config.site ? new URL(base, config.site) : void 0;
const devRootURL = new URL(base, "http://localhost");
const devRoot = site ? site.pathname : devRootURL.pathname;
const devRootReplacement = devRoot.endsWith("/") ? "/" : "";
return function devBaseMiddleware(req, res, next) {
const url = req.url;
let pathname;
try {
pathname = decodeURI(new URL(url, "http://localhost").pathname);
} catch (e) {
return next(e);
}
if (pathname.startsWith(devRoot)) {
req.url = url.replace(devRoot, devRootReplacement);
return next();
}
if (pathname === "/" || pathname === "/index.html") {
const html = subpathNotUsedTemplate(devRoot, pathname);
return writeHtmlResponse(res, 404, html);
}
if (req.headers.accept?.includes("text/html")) {
const html = notFoundTemplate(pathname);
return writeHtmlResponse(res, 404, html);
}
const publicPath = new URL("." + req.url, config.publicDir);
fs.stat(publicPath, (_err, stats) => {
if (stats) {
const publicDir = appendForwardSlash(
path.posix.relative(config.root.pathname, config.publicDir.pathname)
);
const expectedLocation = new URL(devRootURL.pathname + url, devRootURL).pathname;
logger.error(
"router",
`Request URLs for ${colors.bold(
publicDir
)} assets must also include your base. "${expectedLocation}" expected, but received "${url}".`
);
const html = subpathNotUsedTemplate(devRoot, pathname);
return writeHtmlResponse(res, 404, html);
} else {
next();
}
});
};
}
export {
baseMiddleware
};