Initial commit

Next.js + Express event management app for Hope Family Church.
This commit is contained in:
2026-07-23 15:26:47 +02:00
commit fdd2d241b4
246 changed files with 57565 additions and 0 deletions
@@ -0,0 +1,20 @@
const { safeErrorMessage } = require('../utils/errorUtils');
// Not found error handler — don't echo the URL back (leaks route structure)
const notFound = (req, res, next) => {
const error = new Error('Not Found');
res.status(404);
next(error);
};
// General error handler
const errorHandler = (err, req, res, next) => {
const statusCode = res.statusCode === 200 ? 500 : res.statusCode;
res.status(statusCode).json({
message: safeErrorMessage(err),
stack: process.env.NODE_ENV === 'production' ? undefined : err.stack,
});
};
module.exports = { notFound, errorHandler };