Last active
September 25, 2020 22:16
-
-
Save rxgx/59cd3500952a03079de0f008b2655eac to your computer and use it in GitHub Desktop.
Express initial config
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 cors = require('cors'); | |
const express = require('express'); | |
const corsConfig = { | |
optionsSuccessStatus: 200, | |
origin: ['http://localhost:3000', 'http://localhost:8000'] | |
} | |
app = express(); | |
const server = app.listen(3000, () => { | |
const host = server.address().address; | |
const port = server.address().port; | |
console.info('Express now listening on http://%s:%s', host, port); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment