Skip to content

Instantly share code, notes, and snippets.

@Davidegloh
Last active April 25, 2021 14:14
Show Gist options
  • Save Davidegloh/f30b1862c09a5a860b30f5c27196d185 to your computer and use it in GitHub Desktop.
Save Davidegloh/f30b1862c09a5a860b30f5c27196d185 to your computer and use it in GitHub Desktop.
[Express] Config Index.js #indexjs
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