We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1e6e06 commit 3aeb0e3Copy full SHA for 3aeb0e3
Backend/app.js
@@ -12,6 +12,13 @@ if (process.env.NODE_ENV === 'development') app.use(morgan('dev'));
12
app.use(express.json());
13
app.use('/api/plants', plantRouter);
14
15
+app.all('*', (req, res, next) => {
16
+ res.status(404).json({
17
+ status: 'fail',
18
+ message: `Can't find ${req.originalUrl} on this server`,
19
+ });
20
+});
21
+
22
// const userRouter = express.Router();
23
// app.use('/api/user', userRouter);
24
0 commit comments