Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jardix22/b59922dab295f89b9712 to your computer and use it in GitHub Desktop.
Save jardix22/b59922dab295f89b9712 to your computer and use it in GitHub Desktop.
var allowCrossDomain = function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'Content-Type');
next();
}
app.configure(function() {
app.use(express.bodyParser());
app.use(express.cookieParser());
app.use(express.session({ secret: 'cool beans' }));
app.use(express.methodOverride());
app.use(allowCrossDomain);
app.use(app.router);
app.use(express.static(__dirname + '/public'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment