This repository contains the serverless backend services for the FWIS replacement API and the FWIS management tool (FWS-app).
- Node.js 20 or higher
- Appropriate API keys and environment variables (see below)
-
Install dependencies:
npm install
-
API keys can be found in fws-db. Connection details are available in the config files (see
./lib/config.js
for more information). -
Ensure you have the required environment variables (see below).
Environment variables are critical for the correct functioning of the API. These variables can be found in a .profile
file stored in GitLab: GitLab: FWS-config.
You can check the required environment variables in ./lib/config.js
, which contains validation logic for them.
export FWS_ENV_NAME="env-name"
export FWS_LAMBDA_ROLEL="lambda-connection-role"
Ensure all required environment variables are configured correctly before running the project.
To run tests, use the following commands:
-
Run both linter and unit tests:
npm run test
-
Run only unit tests:
npm run unit-test
Auto tests for this project can be found at: GitHub: DEFRA/fws-tests.
The following status codes are returned by the API:
- 200 Created: The request was successful, and a new resource was created.
- 401 Unauthorized: The API key is invalid or missing.
- 403 Forbidden: The request is valid but the API key is not authorized to access this resource with an explicit deny.
- 500 Internal Server Error: An error occurred on the server.
We welcome contributions to this project. Please follow these steps:
- Before submitting a pull request, read the Contribution Guidelines.
- Ensure your code adheres to the coding standards and has appropriate test coverage.
- Submit your pull request, and ensure all automated tests pass.
- Documentation: Ensure your changes are documented appropriately. Any significant changes should be reflected in this README or other documentation.
- API Usage: For usage examples and further API documentation, see the related documentation in the repository or project wiki.
THIS INFORMATION IS LICENSED UNDER THE CONDITIONS OF THE OPEN GOVERNMENT LICENCE found at:
http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3
The following attribution statement MUST be cited in your products and applications when using this information.
Contains public sector information licensed under the Open Government licence v3
The Open Government Licence (OGL) was developed by the Controller of Her Majesty's Stationery Office (HMSO) to enable information providers in the public sector to license the use and re-use of their information under a common open licence.
It is designed to encourage use and re-use of information freely and flexibly, with only a few conditions.