From 56c421848be562abbe5a22bb2b65a7fc09c3b155 Mon Sep 17 00:00:00 2001 From: srgooglo Date: Wed, 22 Jun 2022 17:12:52 +0200 Subject: [PATCH] support to `disableBaseEndpoint` --- src/server/server.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/server/server.js b/src/server/server.js index 21435b0..35e081e 100644 --- a/src/server/server.js +++ b/src/server/server.js @@ -143,7 +143,7 @@ class Server { // output server info InternalConsole.log(`✅ Server is up and running!`) - this.InternalConsoleOutputServerInfo() + this.OutputServerInfo() // handle exit events process.on("SIGTERM", this.cleanupProcess) @@ -260,6 +260,11 @@ class Server { } registerBaseEndpoints() { + if (this.params.disableBaseEndpoint) { + InternalConsole.warn("Base endpoint is disabled! Endpoints mapping will not be available, so linebridge client bridges will not work!") + return false + } + //* register main index endpoint `/` // this is the default endpoint, should return the server info and the map of all endpoints (http & ws) this.registerHTTPEndpoint({ @@ -390,7 +395,7 @@ class Server { } // public methods - InternalConsoleOutputServerInfo = () => { + OutputServerInfo = () => { InternalConsole.log(`🌐 Server info:`) InternalConsole.table({ "ID": this.id,