happilymarrieddad / ws-api

This is an API that utilizes Open Weather API and returns weather data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weather Service API

Instructions

Install dependencies

make install.deps

In order to run the server locally

go run cmd/main.go

Endpoints

/weather

curl 'http://localhost:8000/weather?lat=43.629398&long=-111.773613'

the expected response

{"temperature_feels_like":"moderate","temp":65.82,"conditions_and_alerts":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}]}

Specific temp type

curl 'http://localhost:8000/weather?lat=43.629398&long=-111.773613&tempType=metric'

the expected response

{"temperature_feels_like":"moderate","temp":18.79,"conditions_and_alerts":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}]}%

Make Commands

Generate Mocks

make generate

Run Tests

make test

Docker image

Available here

Run in docker

docker-compose up

About

This is an API that utilizes Open Weather API and returns weather data


Languages

Language:Go 93.6%Language:Shell 3.6%Language:Makefile 1.6%Language:Dockerfile 1.2%