mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-22 11:39:30 -07:00
Add MapClick adapter and "fallback" logic when observations are stale
- Create utils/mapclick.mjs with centralized MapClick API functionality - Refactor modules to use the new utility: - Current Weather - Latest Observations - Regional Forecast - Add staleness checking utility for use by modules
This commit is contained in:
@@ -3,7 +3,7 @@ import express from 'express';
|
||||
import fs from 'fs';
|
||||
import { readFile } from 'fs/promises';
|
||||
import {
|
||||
weatherProxy, radarProxy, outlookProxy, mesonetProxy,
|
||||
weatherProxy, radarProxy, outlookProxy, mesonetProxy, forecastProxy,
|
||||
} from './proxy/handlers.mjs';
|
||||
import playlist from './src/playlist.mjs';
|
||||
import OVERRIDES from './src/overrides.mjs';
|
||||
@@ -129,6 +129,7 @@ if (!process.env?.STATIC) {
|
||||
app.use('/radar/', radarProxy);
|
||||
app.use('/spc/', outlookProxy);
|
||||
app.use('/mesonet/', mesonetProxy);
|
||||
app.use('/forecast/', forecastProxy);
|
||||
|
||||
// Playlist route is available in server mode (not in static mode)
|
||||
app.get('/playlist.json', playlist);
|
||||
|
||||
Reference in New Issue
Block a user