mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 13:07:08 +00:00
Return a JSON response for all 404s.
When an endpoint did not exist, the default expressjs response was being returned, which is text/html.
This commit is contained in:
@@ -360,6 +360,10 @@ app.use(function (err, req, res, next) {
|
||||
}
|
||||
});
|
||||
|
||||
app.get("*", (req, res, next) => {
|
||||
res.status(404).send({status: 404, message: "This endpoint does not exist"});
|
||||
});
|
||||
|
||||
app.disable('x-powered-by');
|
||||
app.enable('trust proxy');
|
||||
INFO('trust proxy is ' + (app.get('trust proxy')? 'on' : 'off'));
|
||||
|
||||
Reference in New Issue
Block a user