Created
June 3, 2018 13:27
-
-
Save oguzcan-yavuz/78bf6e68032cf4355cf0cc94bf144f9a to your computer and use it in GitHub Desktop.
simple cors example
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
const express = require('express'); | |
const cors = require('cors'); | |
let app = express(); | |
const corsOptions = { | |
credentials: true, | |
origin: true, | |
methods: ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE'], | |
exposedHeaders: ['x-auth-token'] | |
}; | |
app.use(cors(corsOptions)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment