Created
September 29, 2016 15:17
-
-
Save josiahwiebe/59313a6d4f91fd8b6f6bbc1ed0233e41 to your computer and use it in GitHub Desktop.
CORS with ExpressJS
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((req, res, next) => { | |
res.header('Access-Control-Allow-Origin', '*') | |
res.header('Access-Control-Allow-Methods', 'GET,OPTIONS') | |
res.header('Access-Control-Allow-Headers', 'content-Type, X-Requested-With') | |
next() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment