added disabled static flag for disable initialization on controllers

This commit is contained in:
srgooglo 2022-05-06 10:43:21 +02:00
parent 32547dbf4a
commit b6f99d580c

View File

@ -151,6 +151,11 @@ class Server {
throw new Error(`Controller must use the controller class!`)
}
if (controller.disabled) {
console.warn(`⏩ Controller [${controller.name}] is disabled! Initialization skipped...`)
return false
}
try {
const ControllerInstance = new controller()