Error handler
parent
7eb6a27665
commit
e4416c0437
3
index.js
3
index.js
|
@ -14,9 +14,10 @@ app.use((err, req, res, next) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use((req, res) => {
|
app.use((req, res) => {
|
||||||
res.status(404).json({ message: 'Resource not found.' });
|
res.status(404).json({ success: false, message: 'Resource not found.' });
|
||||||
});
|
});
|
||||||
|
|
||||||
// Start the server
|
// Start the server
|
||||||
app.listen(port);
|
app.listen(port);
|
||||||
|
|
||||||
console.log(`Server started on port ${port}`);
|
console.log(`Server started on port ${port}`);
|
||||||
|
|
Loading…
Reference in New Issue