Skip to content

Instantly share code, notes, and snippets.

@SidneyAllen
Last active October 29, 2021 18:16
Show Gist options
  • Save SidneyAllen/a73fffda8f685d8e1697dc6d4948abff to your computer and use it in GitHub Desktop.
Save SidneyAllen/a73fffda8f685d8e1697dc6d4948abff to your computer and use it in GitHub Desktop.
// index.js
import express from "express";
import cors from "cors";
import router from "./router.js";
import dotenv from "dotenv";
dotenv.config();
const app = express();
const port = process.env.PORT || 3030;
app.use(cors());
app.use("/", router);
app.listen(port, () => {
console.log(`Listening on port ${port}.`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment