-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
24 lines (21 loc) · 976 Bytes
/
index.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
const express = require('express');
const app = express();
app.use(express.static('public'))
app.set('view engine', 'ejs');
const date = require('date-and-time')
const now = new Date();
app.locals.serverStartTime = date.format(now,'YYYY/MM/DD HH:mm:ss');
app.use('/static', express.static(__dirname + '/public'));
app.get('/', (req, res) => {
res.render('index', {
title: process.env.TITLE || 'The system is currently undergoing maintenance',
message: process.env.MESSAGE || 'We are currently undergoing maintenance. Please check back later.',
supportPhone: process.env.SUPPORT_PHONE || '- - - - - - - - -',
supportEmail: process.env.SUPPORT_EMAIL || '[email protected]',
pageGenerationTimeLabel: process.env.PAGE_GENERATION_LABEL || 'This message was last updated on',
serverStartTime: app.locals.serverStartTime
});
});
const server = app.listen(3000, function () {
console.log('listening to port 3000')
});