add error handling

This commit is contained in:
hippoz 2020-10-05 00:37:01 +03:00
parent e3d4001d0a
commit 0bacce5fcd

View file

@ -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, () => { app.listen(config.server.port, () => {
console.log(`Started server on port ${config.server.port}`); console.log(`Started server on port ${config.server.port}`);
}); });