Skip to content

Commit

Permalink
verifying expressjs/cors#2
Browse files Browse the repository at this point in the history
  • Loading branch information
troygoode committed Apr 28, 2013
1 parent b822e66 commit aaca96f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ app.del('/complex-cors', cors(), function(req, res){
});
});

/* -------------------------------------------------------------------------- */

var issue2options = {
origin: true,
methods: ['POST'],
credentials: true,
maxAge: 3600
};
app.options('/issue-2', cors(issue2options));
app.post('/issue-2', cors(issue2options), function(req, res){
res.json({
text: 'Issue #2 is fixed.'
});
});

if(!module.parent){
app.listen(port, function(){
console.log('Express server listening on port ' + port + '.');
Expand Down

0 comments on commit aaca96f

Please sign in to comment.