Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions proxies/live/apiproxy/resources/jsc/SearchAndReplaceResponse.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,34 +226,6 @@ var searchAndReplaceStrings = [
searchForRegex: /href=\\"\/common-health-questions\//gm,
replaceWithStr: 'href=\\"https://www.nhs.uk/common-health-questions/',
},
{
comment1: "=============================================================",
comment2: "Vaccinations ",
comment3: "=============================================================",
},
{
searchForRegex: /:\s?"https:\/\/api.nhs.uk\/vaccinations\//gm,
replaceWithStr:
': "https://' + requestHostnameEnv + "/nhs-website-content/vaccinations/",
},
{
searchForRegex: /:\s?"https:\/\/www.nhs.uk\/vaccinations\//gm,
replaceWithStr:
': "https://' + requestHostnameEnv + "/nhs-website-content/vaccinations/",
},
{
searchForRegex: /:\s?"\/vaccinations\//gm,
replaceWithStr:
': "https://' + requestHostnameEnv + "/nhs-website-content/vaccinations/",
},
{
searchForRegex: /href=\\"https:\/\/api.nhs.uk\/vaccinations\//gm,
replaceWithStr: 'href=\\"https://www.nhs.uk/vaccinations/',
},
{
searchForRegex: /href=\\"\/vaccinations\//gm,
replaceWithStr: 'href=\\"https://www.nhs.uk/vaccinations/',
},
{
comment1: "=============================================================",
comment2: "Contraception ",
Expand Down Expand Up @@ -288,6 +260,34 @@ var searchAndReplaceStrings = [
searchForRegex: /href=\\"\/contraception\//gm,
replaceWithStr: 'href=\\"https://www.nhs.uk/contraception/',
},
{
comment1: "=============================================================",
comment2: "Vaccinations ",
comment3: "=============================================================",
},
{
searchForRegex: /:\s?"https:\/\/api.nhs.uk\/vaccinations\//gm,
replaceWithStr:
': "https://' + requestHostnameEnv + "/nhs-website-content/vaccinations/",
},
{
searchForRegex: /:\s?"https:\/\/www.nhs.uk\/vaccinations\//gm,
replaceWithStr:
': "https://' + requestHostnameEnv + "/nhs-website-content/vaccinations/",
},
{
searchForRegex: /:\s?"\/vaccinations\//gm,
replaceWithStr:
': "https://' + requestHostnameEnv + "/nhs-website-content/vaccinations/",
},
{
searchForRegex: /href=\\"https:\/\/api.nhs.uk\/vaccinations\//gm,
replaceWithStr: 'href=\\"https://www.nhs.uk/vaccinations/',
},
{
searchForRegex: /href=\\"\/vaccinations\//gm,
replaceWithStr: 'href=\\"https://www.nhs.uk/vaccinations/',
},
];

var responseContent = context.getVariable("response.content");
Expand Down
62 changes: 62 additions & 0 deletions proxies/sandbox/apiproxy/resources/jsc/SearchAndReplaceResponse.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,68 @@
// searchForRegex: /href=\\"\/common-health-questions\//gm,
// replaceWithStr: 'href=\\"https://www.nhs.uk/common-health-questions/',
// },
// {
// comment1: "=============================================================",
// comment2: "Contraception ",
// comment3: "=============================================================",
// },
// {
// searchForRegex: /:\s?"https:\/\/api.nhs.uk\/contraception\//gm,
// replaceWithStr:
// ': "https://' +
Comment thread
adrianparr marked this conversation as resolved.
// requestHostnameEnv +
// "/nhs-website-content/contraception/",
// },
// {
// searchForRegex: /:\s?"https:\/\/www.nhs.uk\/contraception\//gm,
// replaceWithStr:
// ': "https://' +
// requestHostnameEnv +
// "/nhs-website-content/contraception/",
// },
// {
// searchForRegex: /:\s?"\/contraception\//gm,
// replaceWithStr:
// ': "https://' +
// requestHostnameEnv +
// "/nhs-website-content/contraception/",
// },
// {
// searchForRegex: /href=\\"https:\/\/api.nhs.uk\/contraception\//gm,
// replaceWithStr: 'href=\\"https://www.nhs.uk/contraception/',
// },
// {
// searchForRegex: /href=\\"\/contraception\//gm,
// replaceWithStr: 'href=\\"https://www.nhs.uk/contraception/',
// },
// {
// comment1: "=============================================================",
// comment2: "Vaccinations ",
// comment3: "=============================================================",
// },
// {
// searchForRegex: /:\s?"https:\/\/api.nhs.uk\/vaccinations\//gm,
// replaceWithStr:
// ': "https://' + requestHostnameEnv + "/nhs-website-content/vaccinations/",
// },
// {
// searchForRegex: /:\s?"https:\/\/www.nhs.uk\/vaccinations\//gm,
// replaceWithStr:
// ': "https://' + requestHostnameEnv + "/nhs-website-content/vaccinations/",
// },
// {
// searchForRegex: /:\s?"\/vaccinations\//gm,
// replaceWithStr:
// ': "https://' + requestHostnameEnv + "/nhs-website-content/vaccinations/",
// },
// {
// searchForRegex: /href=\\"https:\/\/api.nhs.uk\/vaccinations\//gm,
// replaceWithStr: 'href=\\"https://www.nhs.uk/vaccinations/',
// },
// {
// searchForRegex: /href=\\"\/vaccinations\//gm,
// replaceWithStr: 'href=\\"https://www.nhs.uk/vaccinations/',
// },
// ];

var responseContent = context.getVariable("response.content");
Expand Down
52 changes: 28 additions & 24 deletions sandbox/Sandbox endpoints - localhost.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@

## API Root

[API Root - Without](http://localhost:9000/)

[API Root - With example](http://localhost:9000/)
[API Root](http://localhost:9000/)

## Common Health Questions

[Common Health Questions Root - Without](http://localhost:9000/common-health-questions/)

[Common Health Questions Root - With example](http://localhost:9000/common-health-questions/)
[Common Health Questions Root](http://localhost:9000/common-health-questions/)

[Accidents, first aid and treatments](http://localhost:9000/common-health-questions/accidents-first-aid-and-treatments/)

Expand All @@ -20,9 +16,7 @@

## Conditions

[Conditions Root - Without](http://localhost:9000/conditions/)

[Conditions Root - With example](http://localhost:9000/conditions/)
[Conditions Root](http://localhost:9000/conditions/)

[Conditions Root - Category: A](http://localhost:9000/conditions/?category=a)

Expand Down Expand Up @@ -62,9 +56,7 @@

## Live Well

[Live Well Root - Without](http://localhost:9000/live-well/)

[Live Well Root - With example](http://localhost:9000/live-well/)
[Live Well Root](http://localhost:9000/live-well/)

[Alcohol advice - Alcohol support](http://localhost:9000/live-well/alcohol-advice/alcohol-support/)

Expand All @@ -74,9 +66,7 @@

## Medicines

[Medicines Root - Without](http://localhost:9000/medicines/)

[Medicines Root - With example](http://localhost:9000/medicines/)
[Medicines Root](http://localhost:9000/medicines/)

[Medicines Root - Category: A](http://localhost:9000/medicines/?category=a)

Expand All @@ -102,9 +92,7 @@

## Mental Health

[Mental Health Root - Without](http://localhost:9000/mental-health/)

[Mental Health Root - With example](http://localhost:9000/mental-health/)
[Mental Health Root](http://localhost:9000/mental-health/)

[Advice for life situations and events - Bullying at work](http://localhost:9000/mental-health/advice-for-life-situations-and-events/support-for-workplace-bullying/)

Expand All @@ -114,9 +102,7 @@

## NHS Services

[NHS Services Root - Without](http://localhost:9000/nhs-services/)

[NHS Services Root - With example](http://localhost:9000/nhs-services/)
[NHS Services Root](http://localhost:9000/nhs-services/)

[GPs](http://localhost:9000/nhs-services/gps/)

Expand All @@ -126,12 +112,30 @@

## Pregnancy

[Pregnancy Root - Without](http://localhost:9000/pregnancy/)

[Pregnancy Root - With example](http://localhost:9000/pregnancy/)
[Pregnancy Root](http://localhost:9000/pregnancy/)

[Finding out you're pregnant - Finding out you're pregnant](http://localhost:9000/pregnancy/finding-out/finding-out-you-are-pregnant/)

[Having a baby if you're LGBT+](http://localhost:9000/pregnancy/having-a-baby-if-you-are-lgbt-plus/)

[Trying for a baby](http://localhost:9000/pregnancy/trying-for-a-baby/)

## Contraception

[Contraception Root](http://localhost:9000/contraception/)

[Methods of contraception](http://localhost:9000/contraception/methods-of-contraception/)

[What is the combined pill?](http://localhost:9000/contraception/methods-of-contraception/combined-pill/what-is-it/)

[Condoms](http://localhost:9000/contraception/methods-of-contraception/condoms/)

## Vaccinations

[Vaccinations Root](http://localhost:9000/vaccinations/)

[NHS vaccinations and when to have them](http://localhost:9000/vaccinations/nhs-vaccinations-and-when-to-have-them/)

[6-in-1 vaccine](http://localhost:9000/vaccinations/6-in-1-vaccine/)

[Available travel vaccines](http://localhost:9000/vaccinations/travel-vaccinations/available-travel-vaccines/)
16 changes: 16 additions & 0 deletions sandbox/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,22 @@ app.all('/pregnancy/finding-out/finding-out-you-are-pregnant/', handlers.pregnan
app.all('/pregnancy/having-a-baby-if-you-are-lgbt-plus/', handlers.pregnancyHavingABabyIfYouAreLgbtPlus)
app.all('/pregnancy/trying-for-a-baby/', handlers.pregnancyTryingForABaby)

// ******************************************************************
// ** Contraception pages
// ******************************************************************
app.all('/contraception/', handlers.contraceptionRoot)
app.all('/contraception/methods-of-contraception/', handlers.contraceptionMethodsOfContraception)
app.all('/contraception/methods-of-contraception/combined-pill/what-is-it/', handlers.contraceptionWhatIsTheCombinedPill)
app.all('/contraception/methods-of-contraception/condoms/', handlers.contraceptionCondoms)

// ******************************************************************
// ** Vaccinations pages
// ******************************************************************
app.all('/vaccinations/', handlers.vaccinationsRoot)
app.all('/vaccinations/nhs-vaccinations-and-when-to-have-them/', handlers.vaccinationsNhsVaccinationsAndWhenToHaveThem)
app.all('/vaccinations/6-in-1-vaccine/', handlers.vaccinations6in1Vaccine)
app.all('/vaccinations/travel-vaccinations/available-travel-vaccines/', handlers.vaccinationsAvailableTravelVaccines)

app.use((req, res, next) => {
res.status(404).json(errorResourceNotFoundResponse)
})
Expand Down
Loading