Added Weather API

This commit is contained in:
Pranav Malladi
2025-09-27 18:13:53 -04:00
parent 2471610d80
commit 629444c382
22 changed files with 629 additions and 308 deletions

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Run from repo root. Make sure your Flask app is running (python app.py) first.
# Export your OpenWeather key (do NOT commit it into code):
# export OPENWEATHER_API_KEY="your_real_key_here"
HOST=${HOST:-http://127.0.0.1:5000}
echo "Test 1: env var key (no explicit api_key in payload)"
curl -s -X POST ${HOST}/predict-roadrisk -H "Content-Type: application/json" -d '{"lat":38.9,"lon":-77.0}' | jq
echo "Test 2: explicit api_key in payload (overrides env var)"
curl -s -X POST ${HOST}/predict-roadrisk -H "Content-Type: application/json" -d '{"lat":38.9,"lon":-77.0,"api_key":"MY_OVERRIDE_KEY"}' | jq