-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.js
More file actions
executable file
·37 lines (29 loc) · 948 Bytes
/
app.js
File metadata and controls
executable file
·37 lines (29 loc) · 948 Bytes
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
const { join } = require('node:path')
const NHSPrototypeKit = require('nhsuk-prototype-kit')
// Local dependencies
const config = require('./app/config')
const sessionDataDefaults = require('./app/data/session-data-defaults')
const filters = require('./app/filters')
//const locals = require('./app/locals')
const routes = require('./app/routes')
const SERVICE_NAME = config.serviceName
// Set configuration variables
const port = parseInt(process.env.PORT, 10) || 2000
const viewsPath = [
join(__dirname, 'app/views/'),
join(__dirname, 'app/views/layouts/'),
]
const prototype = NHSPrototypeKit.init({
serviceName: SERVICE_NAME,
routes: routes,
//locals: locals,
sessionDataDefaults: sessionDataDefaults,
viewsPath: viewsPath,
buildOptions: {
entryPoints: ['app/assets/sass/main.scss']
}
})
for (const [name, filter] of Object.entries(filters())) {
prototype.nunjucks.addFilter(name, filter)
}
prototype.start(port)