Skip to content

Commit

Permalink
Enabled CORS on the server
Browse files Browse the repository at this point in the history
  • Loading branch information
MaazAli committed Jan 29, 2015
1 parent 5e834d5 commit 2f5e34d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ var EmbedService = require('./services/embed');
var app = express();
app.use(express.static('demo'));
app.use('/dist', express.static('dist'));

// Enable cors
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});


app.get('/', function(req, res) {
res.sendFile('/');
});
Expand Down

0 comments on commit 2f5e34d

Please sign in to comment.