Skip to content

SOUVIK-D10/Cache-Powered-Weather-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌤 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

About

This is my 3rd backend project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages