Skip to content

Commit

Permalink
test options
Browse files Browse the repository at this point in the history
  • Loading branch information
bailicangdu committed Nov 25, 2018
1 parent d1e231f commit 94fe615
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ app.all('*', (req, res, next) => {
res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS");
res.header("Access-Control-Allow-Credentials", true); //可以带cookies
res.header("X-Powered-By", 'Express');
next();
if (req.method == 'OPTIONS') {
return
} else {
next();
}
});

// app.use(Statistic.apiRecord)
Expand Down

0 comments on commit 94fe615

Please sign in to comment.