Created
September 30, 2021 17:50
-
-
Save alex-hladun/64fadf951c78159f38a031d2d4c49e18 to your computer and use it in GitHub Desktop.
Express server setup
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
import { createServer } from "http"; | |
import express from "express"; | |
import cors from "cors"; | |
const app = express(); | |
app.use( | |
cors({ | |
origin: "http://localhost:3000", | |
methods: ["GET", "POST"], | |
credentials: true | |
}) | |
); | |
const server = createServer(app); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment