Skip to content

Latest commit

 

History

History
95 lines (62 loc) · 1.21 KB

File metadata and controls

95 lines (62 loc) · 1.21 KB

🌤 Cache Powered Weather API

A Spring Boot REST API that provides real-time weather information with built-in caching for performance optimization.


🚀 Features

  • Fetch current weather by city
  • Default fallback city support
  • Cache-powered service layer
  • Clean REST architecture

🛠 Tech Stack

  • Java 17+
  • Spring Boot
  • REST APIs
  • Maven

▶️ Running the Application

./mvnw spring-boot:run

The server starts at:

http://localhost:8080

📡 API Reference

GET /weather

Fetch weather data for a city.

Query Parameters

Parameter Required Description
city No Name of the city (default: Durgapur)

Example Request

curl "http://localhost:8080/weather?city=Delhi"

Example Success Response

{
  "location": {
    "name": "Delhi"
  },
  "current": {
    "temp_c": 32.5
  }
}

Error Handling

Status Code Reason
200 Successful request
406 Weather service unavailable

🧪 Testing

  • Open test-client/index.html in your browser
  • Enter a city
  • View live API response

📜 License

MIT License