Skip to content

Instantly share code, notes, and snippets.

@willkessler
Created May 4, 2016 22:48
Show Gist options
  • Save willkessler/02740c3cad61737bc46295e2236a126b to your computer and use it in GitHub Desktop.
Save willkessler/02740c3cad61737bc46295e2236a126b to your computer and use it in GitHub Desktop.
// https://github.com/expressjs/cors
var express = require('express'), cors = require('cors'), app = express();
//var corsOptions = {
// origin: 'http://130.211.164.16:8282/'
//};
express.static.mime.define({'text/javascript': ['js']});
app.use(cors());
app.use(express.static('public'));
app.listen(8080, function() {
console.log('CORS-enabled web server listening on port 8080');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment