Created
March 13, 2013 22:10
-
-
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://
This file contains 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
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