Skip to content

Instantly share code, notes, and snippets.

@jebai
Forked from ruzzbot/express-middleware.x-domain.js
Last active August 29, 2015 14:22
Show Gist options
  • Save jebai/dc03c75ad04065b5f4b0 to your computer and use it in GitHub Desktop.
Save jebai/dc03c75ad04065b5f4b0 to your computer and use it in GitHub Desktop.
var express = require('express'),
app = express();
app.use( function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
res.header('Access-Control-Allow-Headers', 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept');
next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment