Add error handling
This commit is contained in:
@@ -9,4 +9,8 @@ app.use(express.json());
|
||||
|
||||
app.use('/v1/notes', notesRoutes);
|
||||
|
||||
app.use((req, res) => {
|
||||
res.status(404).json({ error: `Requested path is invalid or does not exist: ${req.method} ${req.originalUrl}` });
|
||||
});
|
||||
|
||||
export default app;
|
||||
|
||||
Reference in New Issue
Block a user