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