Skip to content

Instantly share code, notes, and snippets.

@Andrewpk
Created March 6, 2015 17:21
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 Andrewpk/25bbc40c2f1ab9985eda to your computer and use it in GitHub Desktop.
Save Andrewpk/25bbc40c2f1ab9985eda to your computer and use it in GitHub Desktop.
Simple grunt-contrib-connect options to modify cross-domain policy.
grunt.config(['connect'], {
options: {
port: 9000,
hostname: '*',
keepalive: true,
middleware: function (connect) {
return [
function (request, response, next) {
response.setHeader('Access-Control-Allow-Origin', '*');
return next();
},
connect.static(require('path').resolve('.'))
];
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment