-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
32 lines (22 loc) · 705 Bytes
/
app.js
File metadata and controls
32 lines (22 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
////////////////////////////////////////////////////
require("dotenv").config();
//This pulls the config from the file .env
var bodyParser = require("body-parser");
const express = require("express");
//var fs = require("fs");
var session = require("express-session");
///////////////////////////////////////////////////
const app = express();
app.use(
session({
secret: process.env.SESSION_SECRET,
cookie: { maxAge: parseInt(process.env.SESSION_MAX_AGE) },
resave: true,
saveUninitialized: true,
})
);
app.use(bodyParser.json());
require("./routes.js")(app);
app.listen(process.env.PORT, function () {
console.log("App listening on port " + process.env.PORT + "...");
});