mirror of https://github.com/pelias/api.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
223 B
9 lines
223 B
10 years ago
|
|
||
|
// handle application errors
|
||
|
function middleware(err, req, res, next) {
|
||
|
res.header('Cache-Control','no-cache');
|
||
|
if( res.statusCode < 400 ){ res.status(500); }
|
||
|
res.json({ error: err });
|
||
|
}
|
||
|
|
||
|
module.exports = middleware;
|