A Spring Boot REST API that provides real-time weather information with built-in caching for performance optimization.
- Fetch current weather by city
- Default fallback city support
- Cache-powered service layer
- Clean REST architecture
- Java 17+
- Spring Boot
- REST APIs
- Maven
./mvnw spring-boot:runThe server starts at:
http://localhost:8080
Fetch weather data for a city.
| Parameter | Required | Description |
|---|---|---|
| city | No | Name of the city (default: Durgapur) |
curl "http://localhost:8080/weather?city=Delhi"{
"location": {
"name": "Delhi"
},
"current": {
"temp_c": 32.5
}
}| Status Code | Reason |
|---|---|
| 200 | Successful request |
| 406 | Weather service unavailable |
- Open
test-client/index.htmlin your browser - Enter a city
- View live API response
MIT License