@atolis-hq/corum 0.1.53 → 0.1.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/web/server.js +5 -2
- package/package.json +1 -1
package/dist/src/web/server.js
CHANGED
|
@@ -604,6 +604,7 @@ export function startWebServer(graph, options = {}) {
|
|
|
604
604
|
? 'CORUM_GRAPH_PATH'
|
|
605
605
|
: 'default';
|
|
606
606
|
const port = options.port ?? parseInt(process.env.CORUM_WEB_PORT ?? '3000', 10);
|
|
607
|
+
const host = options.host ?? process.env.CORUM_WEB_HOST;
|
|
607
608
|
const graphPath = options.graphPath ?? process.env.CORUM_GRAPH_PATH ?? path.join(process.cwd(), '.corum/graph');
|
|
608
609
|
const logger = options.logger ?? console.error;
|
|
609
610
|
const reloadEvents = createReloadEvents();
|
|
@@ -644,13 +645,14 @@ export function startWebServer(graph, options = {}) {
|
|
|
644
645
|
: undefined;
|
|
645
646
|
const stopPoller = startGitSourcePoller(options.source, options.gitPollSeconds, logger, () => reloadState('git poll'));
|
|
646
647
|
return new Promise((resolve, reject) => {
|
|
647
|
-
const
|
|
648
|
+
const onListening = () => {
|
|
648
649
|
const addr = server.address();
|
|
649
650
|
if (options.port !== 0) {
|
|
650
651
|
printBanner({
|
|
651
652
|
config: [
|
|
652
653
|
{ key: 'graphPath', value: graphPath },
|
|
653
654
|
{ key: 'webDir', value: WEB_DIR },
|
|
655
|
+
{ key: 'host', value: host ?? 'all interfaces' },
|
|
654
656
|
{ key: 'port', value: String(addr.port) },
|
|
655
657
|
],
|
|
656
658
|
services: [{ name: 'web', url: `http://localhost:${addr.port}` }],
|
|
@@ -664,7 +666,8 @@ export function startWebServer(graph, options = {}) {
|
|
|
664
666
|
server.close(err => (err ? rej(err) : res()));
|
|
665
667
|
}),
|
|
666
668
|
});
|
|
667
|
-
}
|
|
669
|
+
};
|
|
670
|
+
const server = host ? app.listen(port, host, onListening) : app.listen(port, onListening);
|
|
668
671
|
server.on('error', reject);
|
|
669
672
|
});
|
|
670
673
|
}
|