// Check if the route is not found or HTTP method is not supported app.use('*', (req, res) => { if (routes[req.baseUrl]) { res.status(HttpStatus.METHOD_NOT_ALLOWED).json({ message: 'The requested HTTP method is not supported.' }) } else { res.status(HttpStatus.NOT_FOUND).json({ message: 'The requested resource cannot be found.' }) } })