This is a simple application that requests its data from OpenWeather and stores the result in a database.
- Jdk 1.8 or higher
- Maven
- Postgres
- Docker (Optional)
-
Sign up to the openweathermap and get an API key.
-
Set the
com.weather.openweathermap.api_key
configuration property using your API key in the following file.src/main/resources/application.yml
-
Run the
PostgreSQL
and set the datasource configuration properties in the following files:src/main/resources/application.yml src/main/resources/application-docker.yml
mvn clean package
java -jar target/weather-service-x.x.x-SNAPSHOT.jar
mvn clean package
mvn spring-boot:run
cd bin
chmod +x docker-run.sh
./docker-run.sh
After running the service, open the following url in the browser:
http://host:port/v2/api-docs
Simply open the following url in your browser:
http://host:port/weather?city=cityName
The default port is 8080