Created
February 13, 2016 15:17
-
-
Save leosilvadev/54c77d83c5c6976042c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
var port = 8080; | |
app.use(function(req, res, next) { | |
res.setHeader( | |
'Access-Control-Allow-Origin', '*'); | |
res.setHeader( | |
'Access-Control-Allow-Methods', 'GET, POST'); | |
res.setHeader( | |
'Access-Control-Allow-Headers', | |
'X-Requested-With,content-type'); | |
next(); | |
}); | |
app.use(express.static(__dirname + '/static')); | |
app.listen(port); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment