feat: Phase 6+9 real-time уведомления, CSS Modules, UI-правки
This commit is contained in:
@@ -8,6 +8,10 @@ import type { NextFunction, Request, Response } from 'express';
|
||||
* Вызывается после всех маршрутизаторов и передаёт ошибку 404
|
||||
* в централизованный error middleware.
|
||||
*/
|
||||
export function notFoundHandler(req: Request, _res: Response, next: NextFunction): void {
|
||||
export function notFoundHandler(req: Request, res: Response, next: NextFunction): void {
|
||||
// Если ответ уже отправлен (Socket.IO) — не дублируем
|
||||
if (res.headersSent) {
|
||||
return;
|
||||
}
|
||||
next(new ApiError(404, 'NOT_FOUND', `Маршрут не найден: ${req.method} ${req.originalUrl}`));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user