Created
September 29, 2016 15:17
-
-
Save josiahwiebe/2185ccaf1381f11195aa816cbb3a0ebd 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