weather-api

command module
v0.0.0-...-26ab625 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2021 License: MIT Imports: 7 Imported by: 0

README

weather-api

License Build Status Go Report Card GoDoc

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"
    }
  ]
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
v2

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL