@defra-fish/gafl-webapp-service 1.63.0-rc.8 → 1.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/__tests__/server.spec.js +29 -2
- package/src/pages/summary/contact-summary/__tests__/__snapshots__/route.spec.js.snap +29 -29
- package/src/pages/summary/contact-summary/__tests__/route.spec.js +58 -9
- package/src/pages/summary/contact-summary/contact-summary.njk +1 -3
- package/src/pages/summary/contact-summary/route.js +13 -5
- package/src/server.js +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defra-fish/gafl-webapp-service",
|
|
3
|
-
"version": "1.63.0
|
|
3
|
+
"version": "1.63.0",
|
|
4
4
|
"description": "The websales frontend for the GAFL service",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"prepare": "gulp --gulpfile build/gulpfile.cjs"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@defra-fish/business-rules-lib": "1.63.0
|
|
40
|
-
"@defra-fish/connectors-lib": "1.63.0
|
|
39
|
+
"@defra-fish/business-rules-lib": "1.63.0",
|
|
40
|
+
"@defra-fish/connectors-lib": "1.63.0",
|
|
41
41
|
"@defra/hapi-gapi": "^2.0.0",
|
|
42
42
|
"@hapi/boom": "^9.1.2",
|
|
43
43
|
"@hapi/catbox-redis": "^6.0.2",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"./gafl-jest-matchers.js"
|
|
80
80
|
]
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "7cfb8ef668002fc340b755dd3aaa4572063e115c"
|
|
83
83
|
}
|
|
@@ -2,6 +2,7 @@ import { createServer, init, server, layoutContextAmalgamation } from '../server
|
|
|
2
2
|
import CatboxMemory from '@hapi/catbox-memory'
|
|
3
3
|
import uris from '../uri.js'
|
|
4
4
|
import { addLanguageCodeToUri } from '../processors/uri-helper.js'
|
|
5
|
+
import fs from 'fs'
|
|
5
6
|
|
|
6
7
|
jest.mock('../processors/uri-helper.js', () => ({
|
|
7
8
|
addLanguageCodeToUri: jest.fn(),
|
|
@@ -19,6 +20,14 @@ jest.mock('../uri.js', () => ({
|
|
|
19
20
|
RECURRING_TERMS_CONDITIONS: { uri: '/RECURRING_TERMS_CONDITIONS' }
|
|
20
21
|
}))
|
|
21
22
|
|
|
23
|
+
jest.mock('fs', () => {
|
|
24
|
+
const actual = jest.requireActual('fs')
|
|
25
|
+
return {
|
|
26
|
+
...actual,
|
|
27
|
+
readFileSync: jest.fn(() => JSON.stringify({ name: 'gafl-webapp-test', version: '1.2.3' }))
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
|
|
22
31
|
export const catboxOptions = {
|
|
23
32
|
port: 1234,
|
|
24
33
|
cache: [
|
|
@@ -30,8 +39,10 @@ export const catboxOptions = {
|
|
|
30
39
|
]
|
|
31
40
|
}
|
|
32
41
|
|
|
33
|
-
afterEach(() => {
|
|
34
|
-
server.
|
|
42
|
+
afterEach(async () => {
|
|
43
|
+
if (server && server.info && server.info.started && server.phase !== 'stopping') {
|
|
44
|
+
await server.stop()
|
|
45
|
+
}
|
|
35
46
|
})
|
|
36
47
|
|
|
37
48
|
describe('The server', () => {
|
|
@@ -130,6 +141,22 @@ describe('The server', () => {
|
|
|
130
141
|
})
|
|
131
142
|
})
|
|
132
143
|
|
|
144
|
+
it('logs startup details including name and version', async () => {
|
|
145
|
+
const mockPkg = { name: 'gafl-webapp-test', version: '1.2.3' }
|
|
146
|
+
fs.readFileSync.mockReturnValue(JSON.stringify(mockPkg))
|
|
147
|
+
const logSpy = jest.spyOn(console, 'log').mockImplementation(() => {})
|
|
148
|
+
|
|
149
|
+
createServer(catboxOptions)
|
|
150
|
+
await init()
|
|
151
|
+
|
|
152
|
+
expect(logSpy).toHaveBeenCalledWith(
|
|
153
|
+
expect.stringContaining('Server running on %s. name: %s. version: %s'),
|
|
154
|
+
server.info.uri,
|
|
155
|
+
mockPkg.name,
|
|
156
|
+
mockPkg.version
|
|
157
|
+
)
|
|
158
|
+
})
|
|
159
|
+
|
|
133
160
|
describe('layoutContextAmalgamation', () => {
|
|
134
161
|
it('should add query parameters to the response', () => {
|
|
135
162
|
const request = getSampleRequest()
|
|
@@ -66,7 +66,7 @@ Array [
|
|
|
66
66
|
"text": Symbol(contact-summary-row-address),
|
|
67
67
|
},
|
|
68
68
|
"value": Object {
|
|
69
|
-
"text": "14
|
|
69
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
70
70
|
},
|
|
71
71
|
},
|
|
72
72
|
Object {
|
|
@@ -131,7 +131,7 @@ Array [
|
|
|
131
131
|
"text": Symbol(contact-summary-row-address),
|
|
132
132
|
},
|
|
133
133
|
"value": Object {
|
|
134
|
-
"text": "14
|
|
134
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
135
135
|
},
|
|
136
136
|
},
|
|
137
137
|
Object {
|
|
@@ -196,7 +196,7 @@ Array [
|
|
|
196
196
|
"text": Symbol(contact-summary-row-address),
|
|
197
197
|
},
|
|
198
198
|
"value": Object {
|
|
199
|
-
"text": "14
|
|
199
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
200
200
|
},
|
|
201
201
|
},
|
|
202
202
|
Object {
|
|
@@ -261,7 +261,7 @@ Array [
|
|
|
261
261
|
"text": Symbol(contact-summary-row-address),
|
|
262
262
|
},
|
|
263
263
|
"value": Object {
|
|
264
|
-
"text": "14
|
|
264
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
265
265
|
},
|
|
266
266
|
},
|
|
267
267
|
Object {
|
|
@@ -326,7 +326,7 @@ Array [
|
|
|
326
326
|
"text": Symbol(contact-summary-row-address),
|
|
327
327
|
},
|
|
328
328
|
"value": Object {
|
|
329
|
-
"text": "14
|
|
329
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
330
330
|
},
|
|
331
331
|
},
|
|
332
332
|
Object {
|
|
@@ -392,7 +392,7 @@ Array [
|
|
|
392
392
|
"text": Symbol(contact-summary-row-address),
|
|
393
393
|
},
|
|
394
394
|
"value": Object {
|
|
395
|
-
"text": "14
|
|
395
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
396
396
|
},
|
|
397
397
|
},
|
|
398
398
|
Object {
|
|
@@ -458,7 +458,7 @@ Array [
|
|
|
458
458
|
"text": Symbol(contact-summary-row-address),
|
|
459
459
|
},
|
|
460
460
|
"value": Object {
|
|
461
|
-
"text": "14
|
|
461
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
462
462
|
},
|
|
463
463
|
},
|
|
464
464
|
Object {
|
|
@@ -563,7 +563,7 @@ Array [
|
|
|
563
563
|
"text": Symbol(contact-summary-row-address),
|
|
564
564
|
},
|
|
565
565
|
"value": Object {
|
|
566
|
-
"text": "14
|
|
566
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
567
567
|
},
|
|
568
568
|
},
|
|
569
569
|
Object {
|
|
@@ -648,7 +648,7 @@ Array [
|
|
|
648
648
|
"text": Symbol(contact-summary-row-address),
|
|
649
649
|
},
|
|
650
650
|
"value": Object {
|
|
651
|
-
"text": "14
|
|
651
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
652
652
|
},
|
|
653
653
|
},
|
|
654
654
|
Object {
|
|
@@ -753,7 +753,7 @@ Array [
|
|
|
753
753
|
"text": Symbol(contact-summary-row-address),
|
|
754
754
|
},
|
|
755
755
|
"value": Object {
|
|
756
|
-
"text": "14
|
|
756
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
757
757
|
},
|
|
758
758
|
},
|
|
759
759
|
Object {
|
|
@@ -838,7 +838,7 @@ Array [
|
|
|
838
838
|
"text": Symbol(contact-summary-row-address),
|
|
839
839
|
},
|
|
840
840
|
"value": Object {
|
|
841
|
-
"text": "14
|
|
841
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
842
842
|
},
|
|
843
843
|
},
|
|
844
844
|
Object {
|
|
@@ -944,7 +944,7 @@ Array [
|
|
|
944
944
|
"text": Symbol(contact-summary-row-address),
|
|
945
945
|
},
|
|
946
946
|
"value": Object {
|
|
947
|
-
"text": "14
|
|
947
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
948
948
|
},
|
|
949
949
|
},
|
|
950
950
|
Object {
|
|
@@ -1030,7 +1030,7 @@ Array [
|
|
|
1030
1030
|
"text": Symbol(contact-summary-row-address),
|
|
1031
1031
|
},
|
|
1032
1032
|
"value": Object {
|
|
1033
|
-
"text": "14
|
|
1033
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
1034
1034
|
},
|
|
1035
1035
|
},
|
|
1036
1036
|
Object {
|
|
@@ -1136,7 +1136,7 @@ Array [
|
|
|
1136
1136
|
"text": Symbol(contact-summary-row-address),
|
|
1137
1137
|
},
|
|
1138
1138
|
"value": Object {
|
|
1139
|
-
"text": "14
|
|
1139
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
1140
1140
|
},
|
|
1141
1141
|
},
|
|
1142
1142
|
Object {
|
|
@@ -1222,7 +1222,7 @@ Array [
|
|
|
1222
1222
|
"text": Symbol(contact-summary-row-address),
|
|
1223
1223
|
},
|
|
1224
1224
|
"value": Object {
|
|
1225
|
-
"text": "14
|
|
1225
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
1226
1226
|
},
|
|
1227
1227
|
},
|
|
1228
1228
|
Object {
|
|
@@ -1327,7 +1327,7 @@ Array [
|
|
|
1327
1327
|
"text": Symbol(contact-summary-row-address),
|
|
1328
1328
|
},
|
|
1329
1329
|
"value": Object {
|
|
1330
|
-
"text": "14
|
|
1330
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
1331
1331
|
},
|
|
1332
1332
|
},
|
|
1333
1333
|
Object {
|
|
@@ -1432,7 +1432,7 @@ Array [
|
|
|
1432
1432
|
"text": Symbol(contact-summary-row-address),
|
|
1433
1433
|
},
|
|
1434
1434
|
"value": Object {
|
|
1435
|
-
"text": "14
|
|
1435
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
1436
1436
|
},
|
|
1437
1437
|
},
|
|
1438
1438
|
Object {
|
|
@@ -1537,7 +1537,7 @@ Array [
|
|
|
1537
1537
|
"text": Symbol(contact-summary-row-address),
|
|
1538
1538
|
},
|
|
1539
1539
|
"value": Object {
|
|
1540
|
-
"text": "14
|
|
1540
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
1541
1541
|
},
|
|
1542
1542
|
},
|
|
1543
1543
|
Object {
|
|
@@ -1642,7 +1642,7 @@ Array [
|
|
|
1642
1642
|
"text": Symbol(contact-summary-row-address),
|
|
1643
1643
|
},
|
|
1644
1644
|
"value": Object {
|
|
1645
|
-
"text": "14
|
|
1645
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
1646
1646
|
},
|
|
1647
1647
|
},
|
|
1648
1648
|
Object {
|
|
@@ -1748,7 +1748,7 @@ Array [
|
|
|
1748
1748
|
"text": Symbol(contact-summary-row-address),
|
|
1749
1749
|
},
|
|
1750
1750
|
"value": Object {
|
|
1751
|
-
"text": "14
|
|
1751
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
1752
1752
|
},
|
|
1753
1753
|
},
|
|
1754
1754
|
Object {
|
|
@@ -1854,7 +1854,7 @@ Array [
|
|
|
1854
1854
|
"text": Symbol(contact-summary-row-address),
|
|
1855
1855
|
},
|
|
1856
1856
|
"value": Object {
|
|
1857
|
-
"text": "14
|
|
1857
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
1858
1858
|
},
|
|
1859
1859
|
},
|
|
1860
1860
|
Object {
|
|
@@ -1960,7 +1960,7 @@ Array [
|
|
|
1960
1960
|
"text": Symbol(contact-summary-row-address),
|
|
1961
1961
|
},
|
|
1962
1962
|
"value": Object {
|
|
1963
|
-
"text": "14
|
|
1963
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
1964
1964
|
},
|
|
1965
1965
|
},
|
|
1966
1966
|
Object {
|
|
@@ -2046,7 +2046,7 @@ Array [
|
|
|
2046
2046
|
"text": Symbol(contact-summary-row-address),
|
|
2047
2047
|
},
|
|
2048
2048
|
"value": Object {
|
|
2049
|
-
"text": "14
|
|
2049
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
2050
2050
|
},
|
|
2051
2051
|
},
|
|
2052
2052
|
Object {
|
|
@@ -2152,7 +2152,7 @@ Array [
|
|
|
2152
2152
|
"text": Symbol(contact-summary-row-address),
|
|
2153
2153
|
},
|
|
2154
2154
|
"value": Object {
|
|
2155
|
-
"text": "14
|
|
2155
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
2156
2156
|
},
|
|
2157
2157
|
},
|
|
2158
2158
|
Object {
|
|
@@ -2238,7 +2238,7 @@ Array [
|
|
|
2238
2238
|
"text": Symbol(contact-summary-row-address),
|
|
2239
2239
|
},
|
|
2240
2240
|
"value": Object {
|
|
2241
|
-
"text": "14
|
|
2241
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
2242
2242
|
},
|
|
2243
2243
|
},
|
|
2244
2244
|
Object {
|
|
@@ -2345,7 +2345,7 @@ Array [
|
|
|
2345
2345
|
"text": Symbol(contact-summary-row-address),
|
|
2346
2346
|
},
|
|
2347
2347
|
"value": Object {
|
|
2348
|
-
"text": "14
|
|
2348
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
2349
2349
|
},
|
|
2350
2350
|
},
|
|
2351
2351
|
Object {
|
|
@@ -2432,7 +2432,7 @@ Array [
|
|
|
2432
2432
|
"text": Symbol(contact-summary-row-address),
|
|
2433
2433
|
},
|
|
2434
2434
|
"value": Object {
|
|
2435
|
-
"text": "14
|
|
2435
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
2436
2436
|
},
|
|
2437
2437
|
},
|
|
2438
2438
|
Object {
|
|
@@ -2539,7 +2539,7 @@ Array [
|
|
|
2539
2539
|
"text": Symbol(contact-summary-row-address),
|
|
2540
2540
|
},
|
|
2541
2541
|
"value": Object {
|
|
2542
|
-
"text": "14
|
|
2542
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
2543
2543
|
},
|
|
2544
2544
|
},
|
|
2545
2545
|
Object {
|
|
@@ -2626,7 +2626,7 @@ Array [
|
|
|
2626
2626
|
"text": Symbol(contact-summary-row-address),
|
|
2627
2627
|
},
|
|
2628
2628
|
"value": Object {
|
|
2629
|
-
"text": "14
|
|
2629
|
+
"text": "14 Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England",
|
|
2630
2630
|
},
|
|
2631
2631
|
},
|
|
2632
2632
|
Object {
|
|
@@ -30,7 +30,7 @@ jest.mock('../../../../processors/mapping-constants', () => ({
|
|
|
30
30
|
|
|
31
31
|
jest.mock('../../../../processors/refdata-helper.js', () => ({
|
|
32
32
|
countries: {
|
|
33
|
-
nameFromCode: async () => '
|
|
33
|
+
nameFromCode: async () => 'England'
|
|
34
34
|
}
|
|
35
35
|
}))
|
|
36
36
|
|
|
@@ -124,16 +124,65 @@ const getRequestMock = ({
|
|
|
124
124
|
})
|
|
125
125
|
|
|
126
126
|
describe('contact-summary > route', () => {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
describe('generateAddressRow', () => {
|
|
128
|
+
it.each([
|
|
129
|
+
[
|
|
130
|
+
'premises',
|
|
131
|
+
{
|
|
132
|
+
premises: undefined,
|
|
133
|
+
street: 'howecroft court',
|
|
134
|
+
locality: 'eastmead lane',
|
|
135
|
+
town: 'bristol',
|
|
136
|
+
postcode: 'BS9 1HJ',
|
|
137
|
+
country: 'England'
|
|
138
|
+
},
|
|
139
|
+
'Howecroft Court, Eastmead Lane, Bristol, BS9 1HJ, England'
|
|
140
|
+
],
|
|
141
|
+
[
|
|
142
|
+
'street',
|
|
143
|
+
{
|
|
144
|
+
premises: '14',
|
|
145
|
+
street: undefined,
|
|
146
|
+
locality: 'eastmead lane',
|
|
147
|
+
town: 'bristol',
|
|
148
|
+
postcode: 'BS9 1HJ',
|
|
149
|
+
country: 'England'
|
|
150
|
+
},
|
|
151
|
+
'14, Eastmead Lane, Bristol, BS9 1HJ, England'
|
|
152
|
+
],
|
|
153
|
+
[
|
|
154
|
+
'locality',
|
|
155
|
+
{
|
|
156
|
+
premises: '14',
|
|
157
|
+
street: 'howecroft court',
|
|
158
|
+
locality: undefined,
|
|
159
|
+
town: 'bristol',
|
|
160
|
+
postcode: 'BS9 1HJ',
|
|
161
|
+
country: 'Northern Ireland'
|
|
162
|
+
},
|
|
163
|
+
'14, Howecroft Court, Bristol, BS9 1HJ, Northern Ireland'
|
|
164
|
+
],
|
|
165
|
+
[
|
|
166
|
+
'town',
|
|
167
|
+
{
|
|
168
|
+
premises: '14',
|
|
169
|
+
street: 'howecroft court',
|
|
170
|
+
locality: 'eastmead lane',
|
|
171
|
+
town: undefined,
|
|
172
|
+
postcode: 'BS9 1HJ',
|
|
173
|
+
country: 'Wales'
|
|
174
|
+
},
|
|
175
|
+
'14, Howecroft Court, Eastmead Lane, BS9 1HJ, Wales'
|
|
176
|
+
]
|
|
177
|
+
])('omits %s when undefined', (missingField, licenseeOverrides, expectedAddress) => {
|
|
178
|
+
const permission = getMockPermission(licenseeOverrides)
|
|
179
|
+
const request = getRequestMock({ permission })
|
|
180
|
+
const rowGenerator = new route.RowGenerator(request, permission)
|
|
131
181
|
|
|
132
|
-
|
|
133
|
-
const rowGenerator = new route.RowGenerator(request, permission)
|
|
134
|
-
const row = rowGenerator.generateAddressRow('GB')
|
|
182
|
+
const row = rowGenerator.generateAddressRow(licenseeOverrides.country)
|
|
135
183
|
|
|
136
|
-
|
|
184
|
+
expect(row.value.text).toBe(expectedAddress)
|
|
185
|
+
})
|
|
137
186
|
})
|
|
138
187
|
|
|
139
188
|
it('should set status.fromSummary to seen', async () => {
|
|
@@ -41,6 +41,14 @@ const CHANGE_CONTACT = 'change-contact'
|
|
|
41
41
|
|
|
42
42
|
const META_TAG_TELEPHONE_NO = '<meta name="format-detection" content="telephone=no">'
|
|
43
43
|
|
|
44
|
+
function capitalise (str) {
|
|
45
|
+
if (!str) {
|
|
46
|
+
return undefined
|
|
47
|
+
} else {
|
|
48
|
+
return str.toLowerCase().replace(/\b\w/g, char => char.toUpperCase())
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
44
52
|
export class RowGenerator {
|
|
45
53
|
constructor (request, permission) {
|
|
46
54
|
this.request = request
|
|
@@ -114,12 +122,12 @@ export class RowGenerator {
|
|
|
114
122
|
const { licensee } = this.permission
|
|
115
123
|
|
|
116
124
|
const text = [
|
|
117
|
-
licensee.premises
|
|
118
|
-
licensee.street
|
|
119
|
-
licensee.locality
|
|
120
|
-
licensee.town
|
|
125
|
+
capitalise(licensee.premises),
|
|
126
|
+
capitalise(licensee.street),
|
|
127
|
+
capitalise(licensee.locality),
|
|
128
|
+
capitalise(licensee.town),
|
|
121
129
|
licensee.postcode?.toUpperCase(),
|
|
122
|
-
countryName
|
|
130
|
+
countryName
|
|
123
131
|
]
|
|
124
132
|
.filter(Boolean)
|
|
125
133
|
.join(', ')
|
package/src/server.js
CHANGED
|
@@ -34,6 +34,7 @@ import { initialise as initialiseOIDC } from './handlers/oidc-handler.js'
|
|
|
34
34
|
import { getPlugins } from './plugins.js'
|
|
35
35
|
import { airbrake } from '@defra-fish/connectors-lib'
|
|
36
36
|
import { addEmptyFragmentToUri, addLanguageCodeToUri } from './processors/uri-helper.js'
|
|
37
|
+
import fs from 'fs'
|
|
37
38
|
|
|
38
39
|
airbrake.initialise()
|
|
39
40
|
let server
|
|
@@ -220,7 +221,10 @@ const init = async () => {
|
|
|
220
221
|
|
|
221
222
|
logGtmConfig(process.env.GTM_CONTAINER_ID)
|
|
222
223
|
|
|
223
|
-
|
|
224
|
+
const pkgPath = path.join(process.cwd(), 'package.json')
|
|
225
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
|
|
226
|
+
|
|
227
|
+
console.log('Server running on %s. name: %s. version: %s.', server.info.uri, pkg.name, pkg.version)
|
|
224
228
|
}
|
|
225
229
|
|
|
226
230
|
const shutdownBehavior = () => {
|