-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
36 lines (30 loc) · 908 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
25
26
27
28
29
30
31
32
33
34
35
36
require('dotenv').config()
// Start === requiring express modules
const express = require('express')
const useragent = require('express-useragent');
const bodyParser = require('body-parser')
const cors = require('cors')
const path = require('path')
const app = express()
const port = process.env.PORT_STATIC_CONTACT_VALIDATION || 3000
// === END
// Setting views for Administration
app.set('views', path.join(__dirname, 'views'))
app.set('view engine', 'ejs')
// Start === requiring files
const route = require('./routes/route')
// === END
// Start === Setting modules to use
app.use(cors())
app.use(useragent.express())
app.use(bodyParser.urlencoded({extended: true}))
app.use(bodyParser.json())
// === END
// Start === Getting router and setting them
app.use('/verify', route)
// === END
// Start === setting PORT
app.listen(port, () => {
console.log('Sever running on port ' + port)
})
// === END