add error handling
This commit is contained in:
parent
e3d4001d0a
commit
0bacce5fcd
1 changed files with 5 additions and 0 deletions
5
index.js
5
index.js
|
@ -147,6 +147,11 @@ app.post('/api/upload', [ cors(corsOptions) ], (req, res) => {
|
|||
});
|
||||
});
|
||||
|
||||
app.use(function (err, req, res, next) {
|
||||
console.error(err.stack);
|
||||
res.status(500).send('Internal Server Error: Something went wrong');
|
||||
});
|
||||
|
||||
app.listen(config.server.port, () => {
|
||||
console.log(`Started server on port ${config.server.port}`);
|
||||
});
|
Loading…
Reference in a new issue