forked from cmda-minor-web/progressive-web-apps-2021
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
21 lines (16 loc) · 590 Bytes
/
app.js
File metadata and controls
21 lines (16 loc) · 590 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// **** IMPORT PACKAGES **** //
const express = require('express');
const app = express();
const PORT = process.env.PORT || 5000;
const bodyParser = require('body-parser');
const router = require('./routes/router.js');
// **** MIDDLEWARE SET-UP **** //
// Using static files from static directory
app.use(express.static('public'));
app.use(bodyParser.urlencoded({ extended: true }));
// Setting views (EJS)
app.set('views', './views');
app.set('view engine', 'ejs');
// **** ROUTING **** //
app.use('/', router);
app.listen(PORT, () => console.log(`App is running on port ${PORT}`));