-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
30 lines (23 loc) · 770 Bytes
/
app.js
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
// Apigee OIDC facade UI: backend
// June 2021
////////////////////////////////////////////////////
require('dotenv').config()
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)
// serve the files out of ./html as our main files
app.use(express.static(__dirname + '/html'));
app.listen(process.env.PORT, function () {
console.log('App listening on port ' + process.env.PORT + "...")
})