Simple demo rest service to expose GRIB2 wind forecast data
(1 degree, 6 hourly from NOAA) as JSON.
Consumed in leaflet-velocity. Contains a pre-packaged copy of grib2json for conversion.
Data Vis demo here: http://danwild.github.io/leaflet-velocity
Note that this is intended as a crude demonstration, not intended for production use. To get to production; you should improve upon this or build your own.
Requires Docker with Compose plugin.
# copy and edit config (CORS whitelist, retention, etc.)
cp .env.example .env
# build and start
docker compose up -d
# view logs
docker compose logs -f
# stop
docker compose downThe json-data/ folder is mounted as a host volume — wind data persists across container restarts and rebuilds. Files older than RETENTION_DAYS (default: 30) are removed automatically on startup and once per day.
Copy .env.example to .env and adjust as needed:
| Variable | Default | Description |
|---|---|---|
PORT |
7000 |
Server port |
CORS_WHITELIST |
localhost origins | Comma-separated allowed origins |
RETENTION_DAYS |
30 |
Days of JSON data to keep |
NOAA_BASE_URL |
NOMADS GFS filter URL | Override NOAA data source |
HARVEST_DEPTH_DAYS |
7 |
Days back to search for data |
REQUEST_DELAY_MS |
2000 |
Delay between NOAA requests (ms) |
Requires Node.js, npm, and Java JRE (for grib2json conversion).
# from project root:
cp .env.example .env
npm install
npm start- /latest returns the most up to date JSON data available
- /nearest returns JSON data nearest to requested
- $GET params:
timeIsoan ISO timestamp for temporal targetsearchLimitnumber of days to search beyond the timeIso (will search backwards, then forwards)
- $GET params:
- /alive health check url, returns simple message
MIT License (MIT)