ADSB updates

This commit is contained in:
2026-06-25 10:15:23 -04:00
parent 19d2dd2d9d
commit afb530a999
6 changed files with 188 additions and 54 deletions

15
server/src/ais.mjs Normal file
View File

@@ -0,0 +1,15 @@
export async function getAIS() {
const {ADSB_URL} = cfg();
if(!ADSB_URL) return {data: []};
const r = await fetch(`${ADSB_URL}:9990/api/ships_array.json`);
const j = await r.json();
const {keys, values} = j;
const boats = values.map(row => {
const obj = {type: 'vessel'};
keys.forEach((key, i) => obj[key] = row[i]);
return obj;
});
return boats;
}