AIS images

This commit is contained in:
2026-07-04 22:23:16 -04:00
parent be40d845bd
commit 7e8ea62f64
3 changed files with 16 additions and 4 deletions

View File

@@ -165,6 +165,7 @@ app.get('/api/adsb/:icao', asyncHandler(async (req, res) => res.json(await getAD
app.get('/api/ais', asyncHandler(async (req, res) => res.json(await getAIS())));
app.get('/api/ais-image/:mmsi', asyncHandler(async (req, res) => {
const blob = await getAISImage(req.params.mmsi);
if (!blob) return res.status(404).send('No image found');
const buffer = Buffer.from(await blob.arrayBuffer());
res.contentType(blob.type).send(buffer);
}));