Skip to content

ONSdigital/business-index-api

Repository files navigation

business-index-api

Build Status Codacy Badge Coverage Status Dependency Status

Prerequisites

Development Setup

To run ElasticSearch, use Docker:

docker pull docker.elastic.co/elasticsearch/elasticsearch:5.6.9
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "xpack.security.enabled=false" docker.elastic.co/elasticsearch/elasticsearch:5.6.9

Running

To run the business-index-api locally, including the loading of 100,000 test records, run the following:

sbt "run -DONS_BI_ES_RECREATE_INDEX=true -DONS_BI_ES_LOAD_TEST_DATA=true"

Packaging

To package the project into a runnable fat-jar:

sbt assembly

To package the project into a .zip file ready for deployment to CloudFoundry, run the following:

sbt universal:packageBin

API Documentation: swagger-ui

Swagger UI is integrated into business-api. Exposed API documented and available within url:

http://localhost:9000/assets/lib/swagger-ui/index.html?/url=http://localhost:9000/swagger.json

short path: http://localhost:9000/docs

Response Time

Each request-response interaction carries a X-Response-Time header with a millisecond value indicating the server compute time.

Dependencies

A graph detailing all project dependencies can be found here. TODO: update If any sbt changes performed - please re-generate dependency graph by executing:

sbt -no-colors dependencyTree > dependencies.txt

License

Copyright © 2017, Office for National Statistics (https://www.ons.gov.uk)

Released under MIT license, see LICENSE for details.