A simple .NET 9 Web API that provides weather forecast data.
Returns a 5-day weather forecast with random temperature data.
Response:
[
{
"date": "2024-01-15",
"temperatureC": 25,
"temperatureF": 77,
"summary": "Warm"
}
]- .NET 9 SDK
- Git
git clone https://github.com/dummyrepos/dotnetcoreexample.git
cd dotnetcoreexampledotnet builddotnet rundotnet publish -c Release -o ./publishcd publish
dotnet DockerDotnetCore.dll- Development:
https://localhost:5001/weatherforecast - OpenAPI documentation:
https://localhost:5001/openapi/v1.json(Development only)
curl https://localhost:5001/weatherforecastInvoke-RestMethod -Uri "https://localhost:5001/weatherforecast"Each forecast item contains:
date: Date in YYYY-MM-DD formattemperatureC: Temperature in Celsius (-20 to 55)temperatureF: Temperature in Fahrenheit (calculated)summary: Weather description (Freezing, Bracing, Chilly, Cool, Mild, Warm, Balmy, Hot, Sweltering, Scorching)