This commit is contained in:
2026-06-22 00:02:16 -04:00
parent 2c8666db56
commit 2e5227f679
9 changed files with 635 additions and 120 deletions

View File

@@ -9,6 +9,7 @@ import { getOpenMeteo } from './openmeteo.mjs'
import { apiReference } from '@scalar/express-api-reference'
import { spec } from './spec.mjs'
import { existsSync } from 'fs'
import {getAirTraffic, getAirTrafficHistory, getAirTrafficShapes} from './airtraffic.mjs';
const app = express()
const DIR = dirname(fileURLToPath(import.meta.url))
@@ -119,6 +120,11 @@ app.get('/api/daily', async (req, res) => {
res.json(filterArr(result, fields))
})
// -- ADSB ----------------------------------------------------------------------
app.get('/api/air-traffic', async (req, res) => res.json(await getAirTraffic()))
app.get('/api/air-traffic/:icao', async (req, res) => res.json(await getAirTrafficHistory(req.params.icao)))
app.get('/api/air-traffic-shapes', async (req, res) => res.json(await getShapes()))
// ── DOCS ----------------------------------------------------------------------
app.get('/openapi.json', (req, res) => res.json(spec))