This is a simple weather forecast API built using the Micronaut framework, which allows users to get the weather forecast for a specific day and location. The API makes use of the National Weather Service API to fetch weather data.
- Retrieve weather forecast for a specific day and location
- Caching of weather data using Micronaut Cache
- JDK 8 or higher
- Micronaut CLI (optional)
- Clone the repository or download the source code.
git clone https://github.com/yourusername/weather-forecast-api.git
- Navigate to the project directory.
cd weather-forecast-api
- Build the project.
./gradlew build
- Run the application using Gradle.
./gradlew run
Alternatively, you can use Micronaut CLI to run the application.
mn run
- The API will be available at http://localhost:8080.
To get the weather forecast for a specific day and location, make a GET request to the /weather/forecast
endpoint with the following query parameters:
latitude
: Latitude of the locationlongitude
: Longitude of the locationdayForTemperature
: Day for which you want to get the temperature (e.g., "Wednesday Night", "Monday", "Monday Night")
Example request:
GET http://localhost:8080/weather/forecast?latitude=38.8951100&longitude=-77.0363700&dayForTemperature=Wednesday%20Night
Example response:
{
"temperature": "Temperature on Wednesday Night: 55.0 F"
}
N/A