mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-02 20:08:17 +03:00
Fixes #259
This commit is contained in:
+8
-8
@@ -1,6 +1,6 @@
|
||||
import CreateLogCtx from "lib/logger/logger";
|
||||
import server from "server/server";
|
||||
import { CONF_INFO, LOG_LEVEL, PORT, ENABLE_SERVER_HTTPS } from "lib/setup/config";
|
||||
import { ServerTypeInfo, ServerConfig } from "lib/setup/config";
|
||||
import https from "https";
|
||||
import fs from "fs";
|
||||
|
||||
@@ -8,10 +8,10 @@ import { FormatVersion } from "./lib/constants/version";
|
||||
|
||||
const logger = CreateLogCtx(__filename);
|
||||
|
||||
logger.info(`Booting ${CONF_INFO.name} - ${FormatVersion()} [ENV: ${process.env.NODE_ENV}]`);
|
||||
logger.info(`Log level is set to ${LOG_LEVEL}.`);
|
||||
logger.info(`Booting ${ServerTypeInfo.name} - ${FormatVersion()} [ENV: ${process.env.NODE_ENV}]`);
|
||||
logger.info(`Log level is set to ${ServerConfig.LOG_LEVEL}.`);
|
||||
|
||||
if (ENABLE_SERVER_HTTPS) {
|
||||
if (ServerConfig.ENABLE_SERVER_HTTPS) {
|
||||
logger.warn(
|
||||
"HTTPS Mode is enabled. This should not be used in production, and you should instead run behind a reverse proxy."
|
||||
);
|
||||
@@ -20,9 +20,9 @@ if (ENABLE_SERVER_HTTPS) {
|
||||
|
||||
const httpsServer = https.createServer({ key: privateKey, cert: certificate }, server);
|
||||
|
||||
httpsServer.listen(PORT);
|
||||
logger.info(`HTTPS Listening on port ${PORT}`);
|
||||
httpsServer.listen(ServerConfig.PORT);
|
||||
logger.info(`HTTPS Listening on port ${ServerConfig.PORT}`);
|
||||
} else {
|
||||
server.listen(PORT);
|
||||
logger.info(`HTTP Listening on port ${PORT}`);
|
||||
server.listen(ServerConfig.PORT);
|
||||
logger.info(`HTTP Listening on port ${ServerConfig.PORT}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user