Skip to content

Latest commit

 

History

History
47 lines (31 loc) · 3.22 KB

File metadata and controls

47 lines (31 loc) · 3.22 KB

nhs-website-content-api

Build

This is a specification for the nhs-website-content-api API.

  • specification/ This Open API Specification describes the endpoints, methods and messages exchanged by the API. Use it to generate interactive documentation; the contract between the API and its consumers.
  • sandbox/ This NodeJS application implements a mock implementation of the service. Use it as a back-end service to the interactive documentation to illustrate interactions and concepts. It is not intended to provide an exhaustive/faithful environment suitable for full development and testing.
  • scripts/ Utilities helpful to developers of this specification.
  • proxies/ Live (connecting to another service) and sandbox (using the sandbox container) Apigee API Proxy definitions.

Consumers of the API will find developer documentation on the NHS Digital Developer Hub.

Contributing

Contributions to this project are welcome from anyone, providing that they conform to the guidelines for contribution and the community code of conduct.

Licensing

This code is dual licensed under the MIT license and the OGL (Open Government License). Any new work added to this repository must conform to the conditions of these licenses. In particular this means that this project may not depend on GPL-licensed or AGPL-licensed libraries, as these would violate the terms of those libraries' licenses.

The contents of this repository are protected by Crown Copyright (C).

Quick Start

Prerequisites

  • make
  • nodejs + npm/yarn
  • poetry
  • Java 8+

Consider using a dev container. While this is in no way a requirement, you may find it more convenient.

Get Environmental Variables

  1. Make a new .env file in this directory, using example.env as a base.
  2. Fill in the missing environmental variables:
    • At the time of writing, PROXY_NAME should be set to nhs-website-content-api-internal-dev.
    • You can get an APIGEE_ACCESS_TOKEN via the get_token command. If you don't already have access to the get_token command, you can install it using these instructions.
    • You can get the latest SOURCE_COMMIT_ID via the /_ping endpoint of the proxy you're using. For example, with PROXY_NAME set to nhs-website-content-api-internal-dev, we would want to access the URL https://internal-dev.api.service.nhs.uk/nhs-website-content/_ping - this should return some JSON, and the value we want has key commitId.

💡 The make token command provides a useful shorthand for calling get_token with all the right environmental variables.

Let's Roll

  1. Install by running make install from this directory.
  2. Test this installation by running make test, also from this directory.
  3. Try out the preview server by running make publish and then make serve; then visit the local URL printed in the console.