Parliament.uk-static-api is a Sinatra app created by Parliamentary Digital Service that provides mock data for the UK Parliament prototype website, which can be called by any application pointing at this API.
NOTE: This API is in active development and is likely to change at short notice. It is not recommended that you use this in any production environment.
Parliament.uk-static-api requires the following:
- Install all required gems by running in your console:
bundle install
- Ensure Parliament.uk-static-api is running on port 5000 by running in your terminal:
bundle exec puma -p 5000
- An application can then call Parliament.uk-static-api by pointing the application's base URL at the static API. This can be set using environment variables.
PARLIAMENT_BASE_URL=http://localhost:5000/api/v1
- A static file will be served back to the application, depending on the URL visited. (Note: The same response is provided from Parliament.uk-static-api even when using different IDs. Its purpose is to provide an example of a response from a specific endpoint, not an actual response).
The gem is available as open source under the terms of the Open Parliament Licence.