ws4kp-linhanced/server/scripts/modules/utils
Eddy G 7f7cb96231 Add STATIC environment variable for browser-only deployment mode
Implement STATIC=1 environment variable to enable browser-only deployment
without proxy server infrastructure. Uses WS4KP_SERVER_AVAILABLE flag to
distinguish between server-backed and static deployments for proper URL
rewriting and User-Agent header handling.

- Add STATIC env var to skip proxy route registration at startup
- Inject WS4KP_SERVER_AVAILABLE flag via EJS template based on STATIC mode
- Update fetch.mjs to conditionally send User-Agent headers based on server availability
- Update url-rewrite.mjs to skip proxy rewriting when server is unavailable
- Use renderIndex helper for consistent template data across dev/prod modes
- Improve music playlist logging

Benefits of integrated approach:
- Single environment variable controls both server and client behavior
- Flag injection happens once at render time, not on every request
- No runtime HTML string manipulation overhead
- Clean separation between server-backed and static deployment logic
- Same codebase supports both deployment modes without duplication

Static mode (STATIC=1): Direct API calls to external services, no caching
Server mode (default): Local proxy with caching and API request observability
2025-06-26 20:10:11 -04:00
..
cache.mjs Replace CORS proxy with complete server-side cache 2025-06-24 20:45:43 -04:00
calc.mjs Augment missing weather data from METAR when possible; use centralized error handling 2025-06-24 23:05:51 -04:00
debug.mjs Add debug flag management system 2025-06-24 22:53:25 -04:00
elem.mjs weather displays complete 2022-11-22 16:19:10 -06:00
fetch.mjs Add STATIC environment variable for browser-only deployment mode 2025-06-26 20:10:11 -04:00
forecast-utils.mjs Enhance extended forecast parsing and error handling 2025-06-24 23:07:47 -04:00
image.mjs code cleanup 2025-05-29 08:30:01 -05:00
metar.mjs Augment missing weather data from METAR when possible; use centralized error handling 2025-06-24 23:05:51 -04:00
nosleep.mjs Add comprehensive responsive scanline scaling system with anti-aliasing 2025-06-24 22:38:25 -04:00
polygon.mjs initial data and graph 2025-05-15 16:04:57 -05:00
scroll-timing.mjs Refactor timing calculations and improve scroll performance 2025-06-24 23:39:40 -04:00
setting.mjs fix setting boolean-style query string parsing close #106 2025-06-06 16:40:08 -05:00
string.mjs additional eslint rules 2023-01-06 14:39:39 -06:00
units.mjs allow one missing valueon current conditoins #94 #114 2025-06-19 22:50:09 -05:00
url-rewrite.mjs Add STATIC environment variable for browser-only deployment mode 2025-06-26 20:10:11 -04:00
weather.mjs Improve error handling 2025-06-24 23:10:52 -04:00