-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapp.js
More file actions
executable file
·40 lines (33 loc) · 940 Bytes
/
app.js
File metadata and controls
executable file
·40 lines (33 loc) · 940 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
38
39
40
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 globals = require('./app/globals')
const locals = require('./app/locals')
const viewsPath = [
'app/views/',
'node_modules/nhsapp-frontend/dist/'
]
const entryPoints = [
'app/assets/sass/main.scss',
'app/assets/javascript/*.js'
]
async function init() {
const prototype = await NHSPrototypeKit.init({
serviceName: config.serviceName,
buildOptions: {
alias: { jquery: '/assets/javascript/jquery-4.0.0.min.js' },
entryPoints
},
viewsPath,
locals,
filters,
sessionDataDefaults
})
for (const [name, global] of Object.entries(globals(prototype.nunjucks))) {
prototype.nunjucks?.addGlobal(name, global)
}
prototype.start(config.port)
}
init()