/parliament.uk-static-api

A static implementation of the parliament.uk data api. Used for local development, testing and prototyping.

Primary LanguageRuby

Parliament.uk-static-api

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.

License

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.

Requirements

Parliament.uk-static-api requires the following:

Usage

  1. Install all required gems by running in your console:
bundle install
  1. Ensure Parliament.uk-static-api is running on port 5000 by running in your terminal:
bundle exec puma -p 5000
  1. 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
  1. 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).

License

The gem is available as open source under the terms of the Open Parliament Licence.