/nationalparks

Modified Sample Codes for Custom Demo

Primary LanguageJavaApache License 2.0Apache-2.0

National Parks backend application

This application is a backend that provides geolocation information about US National Parks. It is a SpringBoot application.

Prerequisites

  • The information is stored in a MongoDB. Therefore a MongoDB instance with persistent storage needs to be set up.

  • The following Environment Variables need to be configured:

    • MONGODB_SERVER_HOST

    • MONGODB_SERVER_PORT

    • MONGODB_USER

    • MONGODB_PASSWORD

    • MONGODB_DATABASE

  • After installation the following URL loads the default data:

    • <route_url>/ws/data/load

  • The running service maintains a REST endpoint to be discovered at <route_url>/ws/info/

  • There is a health check endpoint at <route_url>/healthz

Hints

  • Use the OpenJDK 1.8 S2I builder image

  • You can set MAVEN_MIRROR_URL as a build environment variable to point to a local artifact repository

  • You may want to set up a post deployment hook to automatically load the data after deployment

  • You may want to create readiness and liveness probes.

Additional API Endpoints

  • Add:

    curl -i -X POST -H 'Content-Type: application/json' -d '{"name":"nationalparks","displayName":"National Parks","url":"", "center":{"latitude": "0", "longitude":"0"},"zoom":"1"}' http://parksmap.apps.127.0.0.01.xip.io/ws/backends/
  • Delete:

    curl -i -X DELETE -H 'Content-Type: application/json' -d '{"name":"nationalparks","displayName":"National Parks","url":"", "center":{"latitude": "0", "longitude":"0"},"zoom":1}' http://parksmap.apps.127.0.0.01.xip.io/ws/backends/
  • List:

    curl -i -X GET -H 'Content-Type: application/json'  http://parksmap.apps.127.0.0.1.xip.io/ws/backends/