import type { Request, Response } from 'express'; import { logger } from '../utils/logger'; import type { ErrorResponse } from '../types/api-types'; export const notFoundHandler = (req: Request, res: Response) => { logger.warn('Route not found', { method: req.method, url: req.url, path: req.path }); const error: ErrorResponse = { error: 'not_found', message: `Route ${req.method} ${req.path} not found`, status_code: 404 }; res.status(404).json(error); };