ADSB
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user