Skip to content

Commit 0433b80

Browse files
adrianparrigba1980
andauthored
Sandbox tweaks (#49)
* Updated package.lock file * WIP * Init basic routes * Added more responses * Added more responses * Added more responses and formatted JSON * Added more responses * Added two more * Checking for ‘subscription-key’ * Catching 404 errors * Added more responses * Added Acne with modules=true * Tidy up * WIP * Added more endpoints * More endpoints * Fixed query params * More endpoints * Added a markdown file with localhost links * Added comments for Apigee Int and Prod environments * Adding in the ‘sandbox’ environment * Updated URLs * Added responses for wildcard examples * Bugfix and tweaks to comments --------- Co-authored-by: Igba ujege <iujege@gmail.com>
1 parent a4145eb commit 0433b80

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

sandbox/handlers.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const log = require('loglevel')
55
const errorResourceNotFoundResponse = require('./responses/error-resource-not-found.json')
66
const errorSandboxResponseNotFound = require('./responses/error-sandbox-response-not-found.json')
77

8-
const commonHealthQuestionsRootResponse = require('./responses/conditions-root-no-params.json')
8+
const commonHealthQuestionsRootResponse = require('./responses/common-health-questions-root-no-params.json')
99
const commonHealthQuestionsAccidentsFirstAidAndTreatmentsResponse = require('./responses/common-health-questions-accidents-first-aid-and-treatments-no-params.json')
1010
const commonHealthQuestionsCaringCarersAndLongTermConditionsResponse = require('./responses/common-health-questions-caring-carers-and-long-term-conditions-no-params.json')
1111
const commonHealthQuestionsChildrensHealthCanMyBabyGoSwimmingBeforeOrAfterVaccinationsResponse = require('./responses/common-health-questions-childrens-health-can-my-baby-go-swimming-before-or-after-vaccinations-no-params.json')
@@ -284,7 +284,7 @@ async function conditionsAchalasia(req, res, next) {
284284

285285
// Modules: false
286286
// This sandbox on localhost
287-
// http://localhost:9000/conditions/acne/?modules=false
287+
// http://localhost:9000/conditions/acne/
288288
// API on Azure API Management
289289
// https://api.nhs.uk/conditions/acne/
290290
// Wagtail (Python) Application (no auth key required)
@@ -321,11 +321,15 @@ async function conditionsAcne(req, res, next) {
321321

322322
// Modules: false
323323
// This sandbox on localhost
324-
// http://localhost:9000/conditions/*?modules=false
324+
// http://localhost:9000/conditions/*
325+
// Apigee Sandbox environment (no auth key required)
326+
// https://sandbox.api.service.nhs.uk/nhs-website-content/conditions/*
325327

326328
// Modules: true
327329
// This sandbox on localhost
328330
// http://localhost:9000/conditions/*?modules=true
331+
// Apigee Sandbox environment (no auth key required)
332+
// https://sandbox.api.service.nhs.uk/nhs-website-content/conditions/*?modules=true
329333
async function conditionsWildcard(req, res, next) {
330334
if (req.query.modules.toLowerCase() === 'true') {
331335
res.status(200).json(conditionsWildcardModulesTrueResponse)
@@ -595,11 +599,15 @@ async function medicinesAcrivastine(req, res, next) {
595599

596600
// Modules: false
597601
// This sandbox on localhost
598-
// http://localhost:9000/medicines/*?modules=false
602+
// http://localhost:9000/medicines/*
603+
// Apigee Sandbox environment (no auth key required)
604+
// https://sandbox.api.service.nhs.uk/nhs-website-content/medicines/*
599605

600606
// Modules: true
601607
// This sandbox on localhost
602608
// http://localhost:9000/medicines/*?modules=true
609+
// Apigee Sandbox environment (no auth key required)
610+
// https://sandbox.api.service.nhs.uk/nhs-website-content/medicines/*?modules=true
603611
async function medicinesWildcard(req, res, next) {
604612
if (req.query.modules.toLowerCase() === 'true') {
605613
res.status(200).json(medicinesWildcardModulesTrueResponse)

0 commit comments

Comments
 (0)