Initial MVP commit
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful

This commit is contained in:
2026-03-17 08:35:16 -05:00
parent 8c092c2247
commit 27817f9e43
29 changed files with 1890 additions and 1 deletions

View File

@@ -1,3 +1,37 @@
# weatherapi
A small HTTP API that serves a variety of weather-related endpoints.
`weatherapi` is a small HTTP API that serves weather data backed by the
PostgreSQL schema populated by `weatherfeeder`.
## Config
`weatherapi` reads a YAML config file that is either:
- a top-level list of database entries, or
- an object with `databases:`.
Example:
```yaml
- name: weatherdb
driver: postgres
params:
uri: postgres://weatherdb:5432/weatherdb?sslmode=disable
username: weatherdb
password: weatherdb
```
## Endpoints
- `GET /observations/current`
- `GET /forecast?timestamp=<RFC3339 timestamp>`
- `GET /alerts/current`
By default, API output is US units for temperature and wind speed:
- temperature fields: Fahrenheit (`*F`)
- wind fields: mph (`*Mph`)
## Run
```bash
go run ./cmd/weatherapi -config ./config.yml -addr :8080
```