ordnance-survey
is a microservice façade for the Ordnance Survey API, encapsulating organisation-wide configuration such as authentication and licensing.
The codebase is predominantly Scala and is implemented against Spray: a lightweight HTTP framework for the JVM.
The application is calling the ordnancesurvey.co.uk service to retrieve addresses from a postcode.
The application is running as part of an exemplar by executing the following command on the exemplar:
sbt sandbox
To run this microservice on its own, you have to create a fat jar and then run this jar. To do so:
sbt assembly
java -jar target/scala-2.11/os-address-lookup-XXX.jar
where XXX is the current version
The listening port is defined in src/main/resources/application.conf, under the `port` property
To see the raw json returned by the ordnance-survey service, go to this url with a web browser:
https://api.ordnancesurvey.co.uk/places/v1/addresses/postcode?postcode=<INSERT POSTCODE WITHOUT SPACES>&dataset=dpa&key=<INSERT API KEY>
To see how this micro-service will re-format that json to a view model, you can send a curl command the micro-service:
curl http://localhost:8083/postcode-to-address?postcode=<INSERT POSTCODE WITHOUT SPACES>
To see the raw json returned by the ordnance-survey service, go to this url with a web browser:
https://api.ordnancesurvey.co.uk/places/v1/addresses/uprn?uprn=<INSERT UPRN>&dataset=dpa&key=<INSERT API KEY>
To see how this micro-service will re-format that json to a view model, you can send a curl command the micro-service:
curl http://localhost:8083/uprn-to-address?uprn=<INSERT UPRN>
Postcode Address File specification
Some interesting false assumptions about addresses
DPA Delivery Point Address (dataset)
LPI Local Property Identifier (dataset)