-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathengine.js
42 lines (35 loc) · 1.54 KB
/
engine.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
41
42
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Node Modules
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const express = require("express")
const bodyParser = require("body-parser")
const cors = require('cors')
const app = express()
const port = process.env.PORT || 3001
const helmet = require('helmet')
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Express Framework
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//disablewebsecurity
app.use(helmet({
contentSecurityPolicy: false
}))
app.use(helmet.crossOriginOpenerPolicy())
app.use(helmet.originAgentCluster())
app.use(bodyParser.urlencoded({
extended: false
}))
app.use(bodyParser.json())
app.use(cors({
credentials: true,
origin: true
}))
app.get('/', function (req, res) {
res.sendFile(__dirname + "/public//index.html")
})
app.use(express.static(__dirname + '/public//src'))
app.listen(port, function () {
console.log("|| Simple dictionary web app || on port # " + '3001' + " ||")
})
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////