- Editorial web platform built with Node.js, Express, EJS, and Vanilla CSS - Markdown content engine with YAML frontmatter, bilingual variants, and hot-reload watcher - Unified SQLite with FTS5 search indexing, query logging, and schema filters - Centered editorial post layout with margin-docked left TOC and mobile bottom sheet - WordPress-grade comment system with moderation dashboard and bulk operations under /guanli - Complete SEO suite (JSON-LD structured data, RSS/Atom feeds, XML sitemap, robots.txt) - CI/CD workflows for linting, security audits (Gitleaks), automated tests, and Docker releases
24 lines
546 B
JavaScript
24 lines
546 B
JavaScript
function notFoundHandler(req, res, next) {
|
|
res.status(404);
|
|
res.render('pages/error', {
|
|
title: '404 - Page Not Found',
|
|
errorCode: 404,
|
|
errorMessage: "The page you are looking for doesn't exist or has moved."
|
|
});
|
|
}
|
|
|
|
function serverErrorHandler(err, req, res, next) {
|
|
console.error('[ServerError]', err);
|
|
res.status(500);
|
|
res.render('pages/error', {
|
|
title: '500 - Server Error',
|
|
errorCode: 500,
|
|
errorMessage: "An unexpected error occurred."
|
|
});
|
|
}
|
|
|
|
module.exports = {
|
|
notFoundHandler,
|
|
serverErrorHandler
|
|
};
|