Last active
October 29, 2021 18:16
-
-
Save SidneyAllen/a73fffda8f685d8e1697dc6d4948abff to your computer and use it in GitHub Desktop.
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
// 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