This is a Spring Boot application that provides a RESTful API to fetch weather information using the OpenWeatherMap API.
- Fetch current weather data by city name
- RESTful API endpoints
- Spring Boot 3.5.3 implementation
- Easy configuration through application properties
- Java 17 or higher
- Maven 3.6 or higher
- OpenWeatherMap API key
- Clone the repository
- Update
src/main/resources/application.propertieswith your OpenWeatherMap API key:openweathermap.api.key=YOUR_API_KEY
To build the application, run:
mvn clean installTo start the application, run:
mvn spring-boot:runThe application will start on the default port 8080.
GET /weather/{city}
Example:
GET /weather/London
Response:
{
"weather information will be returned here"
}src/
├── main/
│ ├── java/
│ │ └── com/
│ │ └── openweathermap/
│ │ ├── controller/
│ │ │ └── WeatherController.java
│ │ ├── model/
│ │ │ └── WeatherResponse.java
│ │ ├── service/
│ │ │ └── WeatherService.java
│ │ └── OpenweathermapApplication.java
│ └── resources/
│ └── application.properties
└── test/
└── java/
└── com/
└── openweathermap/
└── OpenweathermapApplicationTests.java
- Spring Boot 3.5.3
- Spring Web
- Maven
- OpenWeatherMap API
This project is available under the [insert license] license.
Contributions are welcome! Please feel free to submit a Pull Request.