Skip to content

Instantly share code, notes, and snippets.

@alex-hladun
Created September 30, 2021 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alex-hladun/64fadf951c78159f38a031d2d4c49e18 to your computer and use it in GitHub Desktop.
Save alex-hladun/64fadf951c78159f38a031d2d4c49e18 to your computer and use it in GitHub Desktop.
Express server setup
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