Last active
April 25, 2021 14:14
-
-
Save Davidegloh/f30b1862c09a5a860b30f5c27196d185 to your computer and use it in GitHub Desktop.
[Express] Config Index.js #indexjs
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
const dotenv = require('dotenv'); | |
const express = require('express'); | |
dotenv.config(); | |
const PORT = process.env.PORT || 1234; | |
const router = require('./app/router'); | |
const app = express(); | |
app.set('view engine', 'ejs'); | |
app.set('views', 'app/views'); | |
app.use(express.static('public')); | |
app.use(router); | |
app.listen(PORT, () => { | |
console.log(`Listening on ${PORT}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment