✅ Complete Astro migration - PDPA compliant website
- Migrated all pages from Next.js to Astro - Added PDPA-compliant Privacy Policy (Thai) - Added PDPA-compliant Terms & Conditions (Thai) - Added Cookie Policy with disclosure (Thai) - Implemented cookie consent banner (client-side) - Integrated Umami Analytics placeholder - Blog system with 3 posts - Optimized Docker configuration for production - Static site build (184KB, 11 pages) - Ready for Easypanel deployment Backup: /Users/kunthawatgreethong/Gitea/dealplustech-backup-nextjs-20260309.tar.gz
This commit is contained in:
29
dealplustech-astro/node_modules/@astrojs/node/dist/middleware.js
generated
vendored
Normal file
29
dealplustech-astro/node_modules/@astrojs/node/dist/middleware.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import { createAppHandler } from "./serve-app.js";
|
||||
function createMiddleware(app, options) {
|
||||
const handler = createAppHandler(app, options);
|
||||
const logger = app.getAdapterLogger();
|
||||
return async (...args) => {
|
||||
const [req, res, next, locals] = args;
|
||||
if (req instanceof Error) {
|
||||
const error = req;
|
||||
if (next) {
|
||||
return next(error);
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
try {
|
||||
await handler(req, res, next, locals);
|
||||
} catch (err) {
|
||||
logger.error(`Could not render ${req.url}`);
|
||||
console.error(err);
|
||||
if (!res.headersSent) {
|
||||
res.writeHead(500, `Server error`);
|
||||
res.end();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
export {
|
||||
createMiddleware as default
|
||||
};
|
||||
Reference in New Issue
Block a user