Skip to content

Commit bd3926a

Browse files
authored
Updated Search and Replace to include manifest pages JSON (#138)
1 parent 5d9543c commit bd3926a

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

proxies/live/apiproxy/resources/jsc/SearchAndReplaceResponse.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,36 @@ var searchAndReplaceStrings = [
288288
searchForRegex: /href=\\"\/vaccinations\//gm,
289289
replaceWithStr: 'href=\\"https://www.nhs.uk/vaccinations/',
290290
},
291+
{
292+
comment1: "=============================================================",
293+
comment2: "Manifest pages ",
294+
comment3: "=============================================================",
295+
},
296+
{
297+
searchForRegex: /:\s?"https:\/\/www.nhs.uk\/content-api\/manifest\//gm,
298+
replaceWithStr:
299+
': "https://' + requestHostnameEnv + "/nhs-website-content/manifest/",
300+
},
301+
{
302+
searchForRegex:
303+
/"webpage":\s?"https:\/\/internal-dev.api.service.nhs.uk\/nhs-website-content\//gm,
304+
replaceWithStr: '"webpage": "https://www.nhs.uk/',
305+
},
306+
{
307+
searchForRegex:
308+
/"webpage":\s?"https:\/\/internal-qa.api.service.nhs.uk\/nhs-website-content\//gm,
309+
replaceWithStr: '"webpage": "https://www.nhs.uk/',
310+
},
311+
{
312+
searchForRegex:
313+
/"webpage":\s?"https:\/\/int.api.service.nhs.uk\/nhs-website-content\//gm,
314+
replaceWithStr: '"webpage": "https://www.nhs.uk/',
315+
},
316+
{
317+
searchForRegex:
318+
/"webpage":\s?"https:\/\/api.service.nhs.uk\/nhs-website-content\//gm,
319+
replaceWithStr: '"webpage": "https://www.nhs.uk/',
320+
},
291321
];
292322

293323
var responseContent = context.getVariable("response.content");

0 commit comments

Comments
 (0)