Skip to content

Instantly share code, notes, and snippets.

@alexpermiakov
Last active December 12, 2018 17:10
Show Gist options
  • Save alexpermiakov/9c4115ea57df7fd0d86a0a2a1a39cc13 to your computer and use it in GitHub Desktop.
Save alexpermiakov/9c4115ea57df7fd0d86a0a2a1a39cc13 to your computer and use it in GitHub Desktop.
Basic http server with express
import http from "http";
import express from "express";
const router = express();
const { PORT = 3000 } = process.env;
const server = http.createServer(router);
server.listen(PORT, () =>
console.log(`Server is running http://localhost:${PORT}...`)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment