mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-03 05:45:04 +03:00
fix: polish split-port implementation for merge
- Add 30s timeout to API bridge proxy requests to prevent resource exhaustion - Extract healthcheck.mjs script (replaces inline node -e in Dockerfile + compose files) - Add unit tests for runtime port resolution (14 tests, parsePort + resolveRuntimePorts) - Fix formatting in declare global block
This commit is contained in:
14
scripts/healthcheck.mjs
Normal file
14
scripts/healthcheck.mjs
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Docker healthcheck script for OmniRoute.
|
||||
* Checks the /api/settings endpoint on the dashboard port.
|
||||
* Used by Dockerfile and docker-compose files.
|
||||
*/
|
||||
const port = process.env.DASHBOARD_PORT || process.env.PORT || "20128";
|
||||
|
||||
fetch(`http://127.0.0.1:${port}/api/settings`)
|
||||
.then((r) => {
|
||||
if (!r.ok) throw new Error(`HTTP ${r.status}`);
|
||||
})
|
||||
.catch(() => process.exit(1));
|
||||
Reference in New Issue
Block a user