Skip to content

Commit

Permalink
Fix middleware order
Browse files Browse the repository at this point in the history
  • Loading branch information
beaugunderson committed Feb 11, 2014
1 parent f0f88d9 commit faf1a41
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions social-buttons-server.js
Expand Up @@ -32,10 +32,6 @@ var corsOptions = {
}
};

app.use(cors(corsOptions));

app.options('*', cors(corsOptions));

// Block all hosts not in the whitelist
//app.use(function (req, res, next) {
// if (whitelist.indexOf(req.headers.origin) === -1) {
Expand All @@ -52,6 +48,10 @@ app.use(function (req, res, next) {
next();
});

app.use(cors(corsOptions));

app.options('*', cors(corsOptions));

var networkCallbacks = {
twitter: function (url, callback) {
// Twitter is nice and easy
Expand Down

0 comments on commit faf1a41

Please sign in to comment.