The goals of this project is by able to serve a public API that can be consumed by just passing latitude and longitude and we will return the weather condition.
- First copy
env/config.sample.json
intoenv/config.json
- Fill the value from API Key from Openweathermap API
- After filling the value try to run
go mod tidy
- Afterward you can run
go run cmd/api/main.go
You can check our Architecture Diagram here,
We love to elaborate everything that been use ( tech stack ) on this project.
POST /api/v1/weather/search
Body Request:
{
"lat": 10.99,
"lon": 44.34
}
{
"coord": {
"lat": 10.99,
"lon": 44.34
},
"weather": [
{
"id": 802,
"main": "Clouds",
"description": "scattered clouds",
"icon": "03d"
}
],
"main": {
"temp": 303.6,
"temp_min": 303.6,
"temp_max": 303.6,
"humidity": 80
}
}