Skip to content
A RESTful API to check the weather
Go Makefile
Branch: master
Clone or download
Latest commit cef0bb8 Oct 31, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config Add comments to exported functions and structs Dec 6, 2017
controller
model refactor(weather): Return day as string instead of int Oct 10, 2019
parser Revert "Fixed erros when parse description and wind attributes" May 21, 2019
.gitignore
.travis.yml
CONTRIBUTING.md Update CONTRIBUTING.md May 18, 2019
Gopkg.lock Add CORS Jan 16, 2018
Gopkg.toml
LICENSE Initial commit Jul 26, 2017
Makefile Add Makefile Jan 29, 2018
README.md
main.go

README.md

weather-api

License Build Status Go Report Card GoDoc

A REST API to check the current weather.

https://goweather.herokuapp.com/weather/Curitiba
https://goweather.herokuapp.com/weather/{city}

Build

go build

Run

./weather-api

Usage

curl http://localhost:3000/weather/{city}

Example

Request

curl http://localhost:3000/weather/Curitiba

Response

{  
   "temperature":"29 °C",
   "wind":"20 km/h",
   "description":"Partly cloudy",
   "forecast":[  
      {  
         "day":1,
         "temperature":"27 °C",
         "wind":"12 km/h"
      },
      {  
         "day":2,
         "temperature":"22 °C",
         "wind":"8 km/h"
      }
   ]
}
You can’t perform that action at this time.