server: the http{,s} server can't be null

This commit is contained in:
Reto Brunner 2022-11-22 02:21:27 +01:00
parent 4c7337b625
commit 1597c2c56e

View File

@ -132,14 +132,14 @@ export default async function (
return res.sendFile(path.join(packagePath, fileName));
});
let server: import("http").Server | import("https").Server | null = null;
if (Config.values.public && (Config.values.ldap || {}).enable) {
log.warn(
"Server is public and set to use LDAP. Set to private mode if trying to use LDAP authentication."
);
}
let server: import("http").Server | import("https").Server;
if (!Config.values.https.enable) {
const createServer = (await import("http")).createServer;
server = createServer(app);