militaryplanes
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
main.tsx
https://brendanashworth--7853124e839011f0a1870224a6c84d84.web.val.run
A simple HTTP endpoint that fetches military aircraft data from milradar.com API and converts it to GeoJSON format.
Make a GET request to the /planes.geojson
endpoint:
curl https://your-val-town-url/planes.geojson
[ { "id": 8409, "plane_type_id": 1409, "lat": 47.611162, "lon": -68.5568, "gspeed": 433, "type": "C17", "callsign": "BRK81 ", "track": 199, "is_flying": true } ]
{ "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-68.5568, 47.611162] }, "properties": { "id": 8409, "plane_type_id": 1409, "gspeed": 433, "type": "C17", "callsign": "BRK81", "track": 199, "is_flying": true } } ] }
- Coordinate System: Converts from
lat, lon
to GeoJSON[longitude, latitude]
format - Data Cleaning: Trims whitespace from callsigns
- Structure: Wraps individual points in GeoJSON Feature format
- Collection: Groups all features into a FeatureCollection
Content-Type: application/geo+json
Cache-Control: public, max-age=60
(1 minute cache)Access-Control-Allow-Origin: *
(CORS enabled)
Returns appropriate HTTP status codes:
200 OK
: Successful conversion500 Internal Server Error
: Conversion failure (with error details in JSON response)