mirror of
https://github.com/ragestudio/linebridge.git
synced 2025-06-09 10:34:17 +00:00
support to disableBaseEndpoint
This commit is contained in:
parent
81475ac8a3
commit
56c421848b
@ -143,7 +143,7 @@ class Server {
|
|||||||
|
|
||||||
// output server info
|
// output server info
|
||||||
InternalConsole.log(`✅ Server is up and running!`)
|
InternalConsole.log(`✅ Server is up and running!`)
|
||||||
this.InternalConsoleOutputServerInfo()
|
this.OutputServerInfo()
|
||||||
|
|
||||||
// handle exit events
|
// handle exit events
|
||||||
process.on("SIGTERM", this.cleanupProcess)
|
process.on("SIGTERM", this.cleanupProcess)
|
||||||
@ -260,6 +260,11 @@ class Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
registerBaseEndpoints() {
|
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 `/`
|
//* register main index endpoint `/`
|
||||||
// this is the default endpoint, should return the server info and the map of all endpoints (http & ws)
|
// this is the default endpoint, should return the server info and the map of all endpoints (http & ws)
|
||||||
this.registerHTTPEndpoint({
|
this.registerHTTPEndpoint({
|
||||||
@ -390,7 +395,7 @@ class Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// public methods
|
// public methods
|
||||||
InternalConsoleOutputServerInfo = () => {
|
OutputServerInfo = () => {
|
||||||
InternalConsole.log(`🌐 Server info:`)
|
InternalConsole.log(`🌐 Server info:`)
|
||||||
InternalConsole.table({
|
InternalConsole.table({
|
||||||
"ID": this.id,
|
"ID": this.id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user