Skip to content

Commit

Permalink
restrict cors domains
Browse files Browse the repository at this point in the history
  • Loading branch information
ederwms committed Oct 3, 2020
1 parent 4b1b23f commit c448256
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ const routes = require('./routes/v1')

app.use(morgan('dev'))

app.use(cors())
const corsOptions = {
origin: 'https://betheherovue.netlify.app',
optionsSuccessStatus: 200
}

app.use(process.env.NODE_ENV === 'production' ? cors(corsOptions) : cors())
app.use(express.json())
app.use(express.urlencoded({ extended: true }))

Expand Down

0 comments on commit c448256

Please sign in to comment.