Weather Service endpoint demo
Pre-requisites:
- Java 11 (e.g. brew install --cask temurin11, for MacOS install)
- git
How to run Weather Serice demo:
- git clone https://github.com/MartinMKD/WeatherSvcDemo.git
- cd WeatherServiceDemo
- ./gradlew run
The last command will compile/build and run the embedded HTTP service/container bound to http://localhost:8080/weathersvc by default.
If you want to change the port it binds to or the OpenWeather API key used, edit WeatherService.properties w/vi or your favorite editor here:
martin@macbookpro WeatherSvcDemo % pwd
/Users/martin/IdeaProjects/WeatherSvcDemo
martin@macbookpro WeatherSvcDemo % cat ./src/main/resources/WeatherService.properties
httpPort=8080
apiKey=5cf87e4d27fa3db53bbb23b354fdb5a9
martin@macbookpro WeatherSvcDemo %
The above API key does work.
Once it is up and running, to test it, open your favorite browser and enter a URL (e.g.):
For Dallas, TX: http://localhost:8080/weathersvc?lat=32.74&lon=-96.85
For Monett, MO: http://localhost:8080/weathersvc?lat=36.93&lon=-93.93
For San Diego, CA: http://localhost:8080/weathersvc?lat=32.74&lon=-117.11
For Yellowknife, Canada: http://localhost:8080/weathersvc?lat=62.48&lon=-114.43
For Negril, Jamaica: http://localhost:8080/weathersvc?lat=18.27&lon=-78.35
Or any other coordinates you can glean thru Google Maps or similar services, or your Android/iPhone.