Welcome to the Spring Boot Rest API based Weather application.
- Java 8
- Springboot 2.1.6
- apache Maven
- H2 Database (file will be created in home path/db)
- Build the Weather application project using mvn clean install
- Run the application using mvn spring-boot:run
- The web application is accessible via localhost:8080
- Use username : Test and password : Test123 to login to weather application.
- Application URL: Swagger URL: http://localhost:8080/swagger-ui.html.
- In the swagger page please enter the city name that you want to fetch the weather information.
- Enter the API key value as cc22fdb65b00778a6de49a488ebe7438
- Click the execute the button to fetch the weather information. This would fetch the latest weather information from open weather API also persist the same in DB.
- This sample url would help you to access the application from browser. "http://localhost:8080/weather-service/v1/weather?cityName=London&apiKey=cc22fdb65b00778a6de49a488ebe7438"
- Access to H2 console http://localhost:8080/h2-console. user : sa password : password
I have used in memory database as it would fasten the development also to avoid additional db installation.
Weather information saved every time in DB whenever its requested from API since weather is not a constant value.
API key also constantly changing thats why kept as input parameter.