Reduce api size for channel world map in ln dashboard - added spinner - update cache warmer

This commit is contained in:
nymkappa
2022-08-22 17:55:19 +02:00
parent 7fe9029a4e
commit bd1d9573d6
7 changed files with 133 additions and 48 deletions

View File

@@ -102,7 +102,11 @@ class ChannelsRoutes {
private async $getAllChannelsGeo(req: Request, res: Response) {
try {
const channels = await channelsApi.$getAllChannelsGeo(req.params?.publicKey);
const style: string = typeof req.query.style === 'string' ? req.query.style : '';
const channels = await channelsApi.$getAllChannelsGeo(req.params?.publicKey, style);
res.header('Pragma', 'public');
res.header('Cache-control', 'public');
res.setHeader('Expires', new Date(Date.now() + 1000 * 60).toUTCString());
res.json(channels);
} catch (e) {
res.status(500).send(e instanceof Error ? e.message : e);