weather-api
A REST API to check the current weather.
https://weather-restful.herokuapp.com/weather/Singapore
https://weather-restful.herokuapp.com/weather/{city}
Install
dep ensure
Build
go build
Run
./weather-api
Usage
curl http://localhost:3000/weather/{city}
Example
Request
curl http://localhost:3000/weather/Singapore
Response
{
"temperature": "+28 °C",
"wind": "11 km/h",
"description": "Partly cloudy",
"forecast": [
{
"day": "1",
"temperature": "+30 °C",
"wind": "13 km/h"
},
{
"day": "2",
"temperature": "32 °C",
"wind": "5 km/h"
},
{
"day": "3",
"temperature": " °C",
"wind": "11 km/h"
}
]
}