Skip to content

Instantly share code, notes, and snippets.

@jamesmbeams
Created March 13, 2013 22:10
Show Gist options
  • Save jamesmbeams/5156859 to your computer and use it in GitHub Desktop.
Save jamesmbeams/5156859 to your computer and use it in GitHub Desktop.
Prevent "Origin null is not allowed by Access-Control-Allow-Origin" when making an AJAX request to an express server from a file://
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment