From b7573df53e5b6679ace43c58de08e2b6f0e5a712 Mon Sep 17 00:00:00 2001 From: you Date: Sun, 22 Mar 2026 22:26:15 +0000 Subject: [PATCH] Fix: move /api/iata-coords route after app initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Route was at line 16 before express app was created — caused 'Cannot access app before initialization' crash on startup. --- server.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server.js b/server.js index 656ba8e8..e5773075 100644 --- a/server.js +++ b/server.js @@ -12,11 +12,6 @@ const decoder = require('./decoder'); const PAYLOAD_TYPES = decoder.PAYLOAD_TYPES; const { nodeNearRegion, IATA_COORDS } = require('./iata-coords'); -// IATA coordinates for client-side regional filtering -app.get('/api/iata-coords', (req, res) => { - res.json({ coords: IATA_COORDS }); -}); - // Health thresholds — configurable with sensible defaults const _ht = config.healthThresholds || {}; const HEALTH = { @@ -2919,6 +2914,11 @@ app.get('/api/analytics/subpath-detail', (req, res) => { res.json(_sdResult); }); +// IATA coordinates for client-side regional filtering +app.get('/api/iata-coords', (req, res) => { + res.json({ coords: IATA_COORDS }); +}); + // Audio Lab: representative packets bucketed by type app.get('/api/audio-lab/buckets', (req, res) => { const buckets = {};