aa8a0bd83f
Ingest aircraft and vessel tracks via OSINT feeds and tactical CoT, expose viewport-filtered SSE to the map, and add an OSM ALPR layer with tiled caching and performant marker sync.
20 lines
500 B
JavaScript
20 lines
500 B
JavaScript
import { getDb } from '../utils/db.js'
|
|
import { requireAuth } from '../utils/authHelpers.js'
|
|
import { getAlprCameras, parseBbox } from '../utils/alpr.js'
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
requireAuth(event)
|
|
let bbox
|
|
try {
|
|
bbox = parseBbox(getQuery(event))
|
|
}
|
|
catch (error) {
|
|
throw createError({
|
|
statusCode: error?.statusCode || 400,
|
|
message: error?.message || 'invalid bbox',
|
|
})
|
|
}
|
|
const db = await getDb()
|
|
return getAlprCameras(db, bbox)
|
|
})
|