Skip to content

Instantly share code, notes, and snippets.

@baki250
Forked from Vp3n/gist:5340891
Created August 5, 2014 11:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baki250/cac8f4202dcb0947c9d1 to your computer and use it in GitHub Desktop.
Save baki250/cac8f4202dcb0947c9d1 to your computer and use it in GitHub Desktop.
//Allowing CORS (Cross-Origin Resource Sharing) requests from
// grunt server, put this into Gruntfile.js
grunt.initConfig({
connect: {
livereload: {
options: {
port: 9000,
hostname: 'localhost',
middleware: function (connect) {
return [
function(req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', '*');
next();
},
];
}
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment