-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
40 lines (26 loc) · 783 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
31
32
33
34
35
36
37
38
39
40
'use strict';
// node modules
const express = require('express');
const helmet = require('helmet');
require('dotenv').config();
// custom modules
const home = require('./src/routes/home.route');
const checkout = require('./src/routes/checkout.route');
// initial express app
const app = express();
// setting ejs view engine
app.set('view engine', 'ejs');
// setting public folder
app.use(express.static(`${__dirname}/public`));
// setting HTTP response secure headers
app.use(helmet());
// PARSE_REQUEST_BODY
app.use(express.urlencoded({ extended: true }));
// home page
app.use('/', home);
// checkout
app.use('/checkout', checkout);
// Port listening
app.listen(process.env.PORT, () => {
console.log(`app listening on http://localhost:${process.env.PORT}`);
});