ua-snap / data-api

SNAP data API
MIT License
4 stars 0 forks source link

Modifies temperature, precipitation, and taspr routes to not use a wildcard for the endpoint. #445

Closed BobTorgerson closed 5 months ago

BobTorgerson commented 6 months ago

This PR expands the route definitions for temperature, precipitation, and taspr to no longer have a wildcard "catch all" start to the endpoint. Without this change, any non-existent endpoint that ends in point// or area/ was resolving to these endpoints and causing an uncaught error to appear in Varnish (HTTP 503 error).

Example failure:

https://earthmaps.io/foo/bar/point/65/-156

If you run this code, and attempt that endpoint, it correctly gives a "bad request" error message:

http://localhost:5000/foo/bar/point/65/-156

Ensure that you can still get access to the temperature, precipitation, and taspr endpoints for both lat / lon and area summaries.

http://localhost:5000/temperature/point/65.0628/-146.1627 http://localhost:5000/precipitation/point/65.0628/-146.1627 http://localhost:5000/taspr/point/65.0628/-146.1627

http://localhost:5000/temperature/area/19010208 http://localhost:5000/precipitation/area/19010208 http://localhost:5000/taspr/area/19010208

charparr commented 5 months ago

Closes #350