Added helmet for added protection
This commit is contained in:
2
index.js
2
index.js
@@ -3,6 +3,7 @@ const { join } = require('path')
|
|||||||
const express = require('express')
|
const express = require('express')
|
||||||
const cors = require('cors')
|
const cors = require('cors')
|
||||||
const morgan = require('morgan')
|
const morgan = require('morgan')
|
||||||
|
const helmet = require("helmet");
|
||||||
const json = require('big-json')
|
const json = require('big-json')
|
||||||
|
|
||||||
const GeoJsonGeometriesLookup = require("geojson-geometries-lookup")
|
const GeoJsonGeometriesLookup = require("geojson-geometries-lookup")
|
||||||
@@ -15,6 +16,7 @@ const port = 3000
|
|||||||
// Add modules to express app
|
// Add modules to express app
|
||||||
app.use(cors())
|
app.use(cors())
|
||||||
app.use(morgan('common'))
|
app.use(morgan('common'))
|
||||||
|
app.use(helmet())
|
||||||
|
|
||||||
// Static files
|
// Static files
|
||||||
app.use(express.static(join(__dirname, 'public')))
|
app.use(express.static(join(__dirname, 'public')))
|
||||||
|
|||||||
9
package-lock.json
generated
9
package-lock.json
generated
@@ -10,6 +10,7 @@
|
|||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"geojson-geometries-lookup": "^0.5.0",
|
"geojson-geometries-lookup": "^0.5.0",
|
||||||
|
"helmet": "^6.1.5",
|
||||||
"morgan": "^1.10.0"
|
"morgan": "^1.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -436,6 +437,14 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/helmet": {
|
||||||
|
"version": "6.1.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/helmet/-/helmet-6.1.5.tgz",
|
||||||
|
"integrity": "sha512-UgAvdoG0BhF9vcCh/j0bWtElo2ZHHk6OzC98NLCM6zK03DEVSM0vUAtT7iR+oTo2Mi6sGelAH3tL6B/uUWxV4g==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/http-errors": {
|
"node_modules/http-errors": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"geojson-geometries-lookup": "^0.5.0",
|
"geojson-geometries-lookup": "^0.5.0",
|
||||||
|
"helmet": "^6.1.5",
|
||||||
"morgan": "^1.10.0"
|
"morgan": "^1.10.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user