-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
21 lines (21 loc) · 762 Bytes
/
app.js
File metadata and controls
21 lines (21 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const express = require('express');
const path = require('path');
const favicon = require('serve-favicon');
const logger = require('morgan');
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
var rootRoute = require('./root');
// Define our application
const app = express();
// Set 'port' value to either an environment value PORT or 5000
var port = 5000;
// Router listens on / (root)
app.use(bodyParser.urlencoded({ extended: true }));
app.set("view engine", "ejs");
app.use(express.static(__dirname + "/public"));
// Routes
app.use(rootRoute);
// app.use(aboutRoute);
// app.use(eventRoute);
// app.use(projectRoute);
app.listen(process.env.PORT || port, () => console.log(`App listening at http://localhost:${port}`))