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
25 changes: 25 additions & 0 deletions sandbox/Sandbox endpoints - localhost.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@

[Manifest Pages - Page 2](http://localhost:9000/manifest/pages/?page=2)

## Health A to Z

[Health A to Z Root](http://localhost:9000/health-a-to-z/)

[Health A to Z: Common conditions](http://localhost:9000/health-a-to-z/conditions)

## Conditions

Expand Down Expand Up @@ -168,3 +173,23 @@
[Tests and treatments - Page: 1](http://localhost:9000/tests-and-treatments/?page=1)

[Tests and treatments - Page: 7](http://localhost:9000/tests-and-treatments/?page=7)

## Baby

[Baby Root](http://localhost:9000/baby/)

[First aid and safety](http://localhost:9000/baby/first-aid-and-safety/)

[Support and services](http://localhost:9000/baby/support-and-services/)

[Caring for a newborn](http://localhost:9000/baby/caring-for-a-newborn/)

## Social care and support

[Social care and support Root](http://localhost:9000/social-care-and-support/)

[Introduction to care and support](http://localhost:9000/social-care-and-support/introduction-to-care-and-support/)

[Money, work, benefits and social care](http://localhost:9000/social-care-and-support/money-work-and-benefits/)

[Care after a hospital stay](http://localhost:9000/social-care-and-support/care-after-a-hospital-stay/)
24 changes: 24 additions & 0 deletions sandbox/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,30 @@ app.all('/symptoms/', handlers.symptomsRoot)
// ******************************************************************
app.all('/tests-and-treatments/', handlers.testsAndTreatmentsRoot)

// ******************************************************************
// ** Health A to Z
// ******************************************************************
app.all('/health-a-to-z/', handlers.healthAToZRoot)
app.all('/health-a-to-z/conditions/', handlers.healthAToZConditions)

// ******************************************************************
// ** Baby
// ******************************************************************
app.all('/baby/', handlers.babyRoot)
app.all('/baby/first-aid-and-safety/', handlers.babyFirstAidAndSafety)
app.all('/baby/support-and-services/', handlers.babySupportAndServices)
app.all('/baby/caring-for-a-newborn/', handlers.babyCaringForANewborn)


// ******************************************************************
// ** Social care and support
// ******************************************************************
app.all('/social-care-and-support/', handlers.socialCareAndSupportRoot)
app.all('/social-care-and-support/introduction-to-care-and-support/', handlers.socialCareAndSupportIntroductionToCareAndSupport)
app.all('/social-care-and-support/money-work-and-benefits/', handlers.socialCareAndSupportMoneyWorkAndBenefits)
app.all('/social-care-and-support/care-after-a-hospital-stay/', handlers.socialCareAndSupportCareAfterAHospitalStay)


app.use((req, res, next) => {
res.status(404).json(errorResourceNotFoundResponse)
})
Expand Down
213 changes: 213 additions & 0 deletions sandbox/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,22 @@ const testsAndTreatmentsRootCategoryBResponse = require('./responses/tests-and-t
const testsAndTreatmentsRootPage1Response = require('./responses/tests-and-treatments-root-page-1.json')
const testsAndTreatmentsRootPage7Response = require('./responses/tests-and-treatments-root-page-7.json')

// Health A to Z - Responses
const healthAToZRootNoParamsResponse = require('./responses/health-a-to-z-root-no-params.json')
const healthAToZConditionsNoParamsResponse = require('./responses/health-a-to-z-conditions-no-params.json')

// Baby - Responses
const babyRootNoParamsResponse = require('./responses/baby-root-no-params.json')
const babyFirstAidAndSafetyNoParamsResponse = require('./responses/baby-first-aid-and-safety-no-params.json')
const babySupportAndServicesNoParamsResponse = require('./responses/baby-support-and-services-no-params.json')
const babyCaringForANewbornNoParamsResponse = require('./responses/baby-caring-for-a-newborn-no-params.json')

// Social care and support - Responses
const socialCareAndSupportRootNoParamsResponse = require('./responses/social-care-and-support-root-no-params.json')
const socialCareAndSupportIntroductionToCareAndSupportNoParamsResponse = require('./responses/social-care-and-support-introduction-to-care-and-support-no-params.json')
const socialCareAndSupportMoneyWorkAndBenefitsNoParamsResponse = require('./responses/social-care-and-support-money-work-and-benefits-no-params.json')
const socialCareAndSupportCareAfterAHospitalStayNoParamsResponse = require('./responses/social-care-and-support-care-after-a-hospital-stay-no-params.json')

// ******************************************************************
// ** Root page
// ******************************************************************
Expand Down Expand Up @@ -1218,6 +1234,139 @@ async function testsAndTreatmentsRoot(req, res, next) {
next()
}


// ******************************************************************
// ** Health A to Z
// ******************************************************************

// Live website URL
// https://www.nhs.uk/health-a-to-z/
// This sandbox on localhost
// http://localhost:9000/health-a-to-z/
// API on Azure API Management
// https://api.nhs.uk/health-a-to-z/
// Wagtail (Python) Application (no auth key required)
// https://www.nhs.uk/content-api/health-a-to-z/
// Apigee Sandbox environment (no auth key required)
// https://sandbox.api.service.nhs.uk/nhs-website-content/health-a-to-z/
// Apigee Integration environment ('apikey' required in Header)
// https://int.api.service.nhs.uk/nhs-website-content/health-a-to-z/
// Apigee Production environment ('apikey' required in Header)
// https://api.service.nhs.uk/nhs-website-content/health-a-to-z/
async function healthAToZRoot(req, res, next) {
res.status(200).json(healthAToZRootNoParamsResponse)
res.end()
next()
}

// ******************************************************************
// ** Health A to Z - Conditions
// ******************************************************************

// Live website URL
// https://www.nhs.uk/health-a-to-z/conditions/
// This sandbox on localhost
// http://localhost:9000/health-a-to-z/conditions/
// API on Azure API Management
// https://api.nhs.uk/health-a-to-z/conditions/
// Wagtail (Python) Application (no auth key required)
// https://www.nhs.uk/content-api/health-a-to-z/conditions/
// Apigee Sandbox environment (no auth key required)
// https://sandbox.api.service.nhs.uk/nhs-website-content/health-a-to-z/conditions/
// Apigee Integration environment ('apikey' required in Header)
// https://int.api.service.nhs.uk/nhs-website-content/health-a-to-z/conditions/
// Apigee Production environment ('apikey' required in Header)
// https://api.service.nhs.uk/nhs-website-content/health-a-to-z/conditions/
async function healthAToZConditions(req, res, next) {
res.status(200).json(healthAToZConditionsNoParamsResponse)
res.end()
next()
}

// ******************************************************************
// ** Baby
// ******************************************************************

// Live website URL
// https://www.nhs.uk/baby/
// This sandbox on localhost
// http://localhost:9000/baby/
// API on Azure API Management
// https://api.nhs.uk/baby/
// Wagtail (Python) Application (no auth key required)
// https://www.nhs.uk/content-api/baby/
// Apigee Sandbox environment (no auth key required)
// https://sandbox.api.service.nhs.uk/nhs-website-content/baby/
// Apigee Integration environment ('apikey' required in Header)
// https://int.api.service.nhs.uk/nhs-website-content/baby/
// Apigee Production environment ('apikey' required in Header)
// https://api.service.nhs.uk/nhs-website-content/baby/
async function babyRoot(req, res, next) {
res.status(200).json(babyRootNoParamsResponse)
res.end()
next()
}

// Live website URL
// https://www.nhs.uk/baby/first-aid-and-safety/
// This sandbox on localhost
// http://localhost:9000/baby/first-aid-and-safety/
// API on Azure API Management
// https://api.nhs.uk/baby/first-aid-and-safety/
// Wagtail (Python) Application (no auth key required)
// https://www.nhs.uk/content-api/baby/first-aid-and-safety/
// Apigee Sandbox environment (no auth key required)
// https://sandbox.api.service.nhs.uk/nhs-website-content/baby/first-aid-and-safety/
// Apigee Integration environment ('apikey' required in Header)
// https://int.api.service.nhs.uk/nhs-website-content/baby/first-aid-and-safety/
// Apigee Production environment ('apikey' required in Header)
// https://api.service.nhs.uk/nhs-website-content/baby/first-aid-and-safety/
async function babyFirstAidAndSafety(req, res, next) {
res.status(200).json(babyFirstAidAndSafetyNoParamsResponse)
res.end()
next()
}

// Live website URL
// https://www.nhs.uk/baby/caring-for-a-newborn/
// This sandbox on localhost
// http://localhost:9000/baby/caring-for-a-newborn/
// API on Azure API Management
// https://api.nhs.uk/baby/caring-for-a-newborn/
// Wagtail (Python) Application (no auth key required)
// https://www.nhs.uk/content-api/baby/caring-for-a-newborn/
// Apigee Sandbox environment (no auth key required)
// https://sandbox.api.service.nhs.uk/nhs-website-content/baby/caring-for-a-newborn/
// Apigee Integration environment ('apikey' required in Header)
// https://int.api.service.nhs.uk/nhs-website-content/baby/caring-for-a-newborn/
// Apigee Production environment ('apikey' required in Header)
// https://api.service.nhs.uk/nhs-website-content/baby/caring-for-a-newborn/
async function babyCaringForANewborn(req, res, next) {
res.status(200).json(babyCaringForANewbornNoParamsResponse)
res.end()
next()
}

// Live website URL
// https://www.nhs.uk/baby/support-and-service/
// This sandbox on localhost
// http://localhost:9000/baby/support-and-service/
// API on Azure API Management
// https://api.nhs.uk/baby/support-and-service/
// Wagtail (Python) Application (no auth key required)
// https://www.nhs.uk/content-api/baby/support-and-service/
// Apigee Sandbox environment (no auth key required)
// https://sandbox.api.service.nhs.uk/nhs-website-content/baby/support-and-service/
// Apigee Integration environment ('apikey' required in Header)
// https://int.api.service.nhs.uk/nhs-website-content/baby/support-and-service/
// Apigee Production environment ('apikey' required in Header)
// https://api.service.nhs.uk/nhs-website-content/baby/support-and-service/
async function babySupportAndServices(req, res, next) {
res.status(200).json(babySupportAndServicesNoParamsResponse)
res.end()
next()
}

// ******************************************************************
// ** Status
// ******************************************************************
Expand All @@ -1233,9 +1382,67 @@ async function status(req, res, next) {
next()
}

// ******************************************************************
// ** Social care and support pages
// ******************************************************************

// Live website URL
// https://www.nhs.uk/social-care-and-support/
// This sandbox on localhost
// http://localhost:9000/social-care-and-support/
// API on Azure API Management
// https://api.nhs.uk/social-care-and-support/
// Wagtail (Python) Application (no auth key required)
// https://www.nhs.uk/content-api/social-care-and-support/
// Apigee Sandbox environment (no auth key required)
// https://sandbox.api.service.nhs.uk/nhs-website-content/social-care-and-support/
// Apigee Integration environment ('apikey' required in Header)
// https://int.api.service.nhs.uk/nhs-website-content/social-care-and-support/
// Apigee Production environment ('apikey' required in Header)
// https://api.service.nhs.uk/nhs-website-content/social-care-and-support/
async function socialCareAndSupportRoot(req, res, next) {
res.status(200).json(socialCareAndSupportRootNoParamsResponse)
res.end()
next()
}

// Live website URL
// https://www.nhs.uk/social-care-and-support/introduction-to-care-and-support/
// This sandbox on localhost
// http://localhost:9000/social-care-and-support/introduction-to-care-and-support/
async function socialCareAndSupportIntroductionToCareAndSupport(req, res, next) {
res.status(200).json(socialCareAndSupportIntroductionToCareAndSupportNoParamsResponse)
res.end()
next()
}

// Live website URL
// https://www.nhs.uk/social-care-and-support/money-work-and-benefits/
// This sandbox on localhost
// http://localhost:9000/social-care-and-support/money-work-and-benefits/
async function socialCareAndSupportMoneyWorkAndBenefits(req, res, next) {
res.status(200).json(socialCareAndSupportMoneyWorkAndBenefitsNoParamsResponse)
res.end()
next()
}

// Live website URL
// https://www.nhs.uk/social-care-and-support/care-after-a-hospital-stay/
// This sandbox on localhost
// http://localhost:9000/social-care-and-support/care-after-a-hospital-stay/
async function socialCareAndSupportCareAfterAHospitalStay(req, res, next) {
res.status(200).json(socialCareAndSupportCareAfterAHospitalStayNoParamsResponse)
res.end()
next()
}

module.exports = {
root,
manifestPagesRoot,
babyCaringForANewborn,
babyFirstAidAndSafety,
babyRoot,
babySupportAndServices,
conditionsAcanthosisNigricans,
conditionsAchalasia,
conditionsAcne,
Expand All @@ -1248,6 +1455,8 @@ module.exports = {
contraceptionMethodsOfContraception,
contraceptionRoot,
contraceptionWhatIsTheCombinedPill,
healthAToZRoot,
healthAToZConditions,
liveWellAlcoholAdviceAlcoholSupport,
liveWellExercise,
liveWellHealthyWeight,
Expand Down Expand Up @@ -1277,6 +1486,10 @@ module.exports = {
womensHealthAnaemia,
womensHealthPeriods,
womensHealthRoot,
socialCareAndSupportRoot,
socialCareAndSupportIntroductionToCareAndSupport,
socialCareAndSupportMoneyWorkAndBenefits,
socialCareAndSupportCareAfterAHospitalStay,
symptomsRoot,
testsAndTreatmentsRoot,
}
35 changes: 35 additions & 0 deletions sandbox/responses/_curl-commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ curl -X GET 'https://api.service.nhs.uk/nhs-website-content/symptoms/' -H 'apike

curl -X GET 'https://api.service.nhs.uk/nhs-website-content/tests-and-treatments/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/tests-and-treatments-root-no-params.json

curl -X GET 'https://api.service.nhs.uk/nhs-website-content/health-a-to-z/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/health-a-to-z-root-no-params.json

curl -X GET 'https://api.service.nhs.uk/nhs-website-content/baby/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/baby-root-no-params.json

curl -X GET 'https://api.service.nhs.uk/nhs-website-content/social-care-and-support/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/social-care-and-support-root-no-params.json


*****************************************************************************************************************
** Manifest pages **
Expand All @@ -36,6 +42,17 @@ curl -X GET 'https://api.service.nhs.uk/nhs-website-content/manifest/pages/?page
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/manifest/pages/?page=2' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/manifest-pages-root-page-2.json


*****************************************************************************************************************
** Baby pages **
*****************************************************************************************************************

curl -X GET 'https://api.service.nhs.uk/nhs-website-content/baby/first-aid-and-safety/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/baby-first-aid-and-safety-no-params.json

curl -X GET 'https://api.service.nhs.uk/nhs-website-content/baby/support-and-services/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/baby-support-and-services-no-params.json

curl -X GET 'https://api.service.nhs.uk/nhs-website-content/baby/caring-for-a-newborn/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/baby-caring-for-a-newborn-no-params.json


*****************************************************************************************************************
** Conditions pages **
*****************************************************************************************************************
Expand Down Expand Up @@ -191,3 +208,21 @@ curl -X GET 'https://api.service.nhs.uk/nhs-website-content/tests-and-treatments
curl -X GET 'https://api.service.nhs.uk/nhs-website-content/tests-and-treatments/?page=1' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/tests-and-treatments-root-page-1.json

curl -X GET 'https://api.service.nhs.uk/nhs-website-content/tests-and-treatments/?page=7' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/tests-and-treatments-root-page-7.json


*****************************************************************************************************************
** Health A to Z: Common conditions **
*****************************************************************************************************************

curl -X GET 'https://api.service.nhs.uk/nhs-website-content/health-a-to-z/conditions/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/health-a-to-z-conditions-no-params.json


*****************************************************************************************************************
** Social care and support pages **
*****************************************************************************************************************

curl -X GET 'https://api.service.nhs.uk/nhs-website-content/social-care-and-support/introduction-to-care-and-support/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/social-care-and-support-introduction-to-care-and-support-no-params.json

curl -X GET 'https://api.service.nhs.uk/nhs-website-content/social-care-and-support/money-work-and-benefits/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/social-care-and-support-money-work-and-benefits-no-params.json

curl -X GET 'https://api.service.nhs.uk/nhs-website-content/social-care-and-support/care-after-a-hospital-stay/' -H 'apikey: Oq5LuCPc5X69KFlIw6P7TVYrrJHSceX8' >> ./responses/social-care-and-support-care-after-a-hospital-stay-no-params.json
Loading
Loading