linebridge/server/bootloader/bootWrapper.js
SrGooglo 1449695714 Update server dependency and remove legacy code
Bump version to 1.0.0-a3 and remove unused websocket functionality

server/bootloader/bootWrapper.js is now included in package files

This commit updates hyper-express reference to "he" in README, removes
the unused he-legacy engine and socket.io related dependencies.
2025-04-24 12:35:02 +00:00

48 lines
886 B
JavaScript

const injectEnvFromInfisical = require("./injectEnvFromInfisical")
module.exports = async function Boot(main) {
if (!main) {
throw new Error("main class is not defined")
}
console.log(
`[BOOT] Booting in [${global.isProduction ? "production" : "development"}] mode...`,
)
if (
process.env.INFISICAL_CLIENT_ID &&
process.env.INFISICAL_CLIENT_SECRET
) {
console.log(
`[BOOT] INFISICAL Credentials found, injecting env variables from INFISICAL...`,
)
await injectEnvFromInfisical()
}
const instance = new main()
process.on("exit", (code) => {
console.log(`[BOOT] Closing ...`)
instance._fireClose()
})
process.on("SIGTERM", () => {
process.exit(0)
})
process.on("SIGINT", () => {
process.exit(0)
})
await instance.initialize()
if (process.env.lb_service && process.send) {
process.send({
status: "ready",
})
}
return instance
}