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.
18 lines
377 B
18 lines
377 B
9 years ago
|
|
||
|
/**
|
||
|
this functionality is required by CORS as the browser will send an
|
||
|
HTTP OPTIONS request before performing the CORS request.
|
||
|
|
||
|
if the OPTIONS request returns a non-200 status code then the
|
||
|
transaction will fail.
|
||
|
**/
|
||
|
|
||
|
function middleware(req, res, next){
|
||
|
if( req.method === 'OPTIONS' ){
|
||
|
res.send(200);
|
||
|
} else {
|
||
|
next();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = middleware;
|