mirror of
https://github.com/spacebarchat/server.git
synced 2026-11-12 14:19:21 +00:00
Use getter for EnvConfig
This commit is contained in:
1 parent
b0c5b5997a
commit
4e7ff64068
14 files changed
+60
-54
No files matched your search
@@ -61,13 +61,13 @@ async function main() {
|
||||
await initDatabase();
|
||||
await Config.init();
|
||||
|
||||
const logRequests = EnvConfig.logging.logRequests != "";
|
||||
const logRequests = EnvConfig.get().logging.logRequests != "";
|
||||
if (logRequests) {
|
||||
app.use(
|
||||
morgan("combined", {
|
||||
skip: (req, res) => {
|
||||
let skip = !(EnvConfig.logging.logRequests.includes(res.statusCode.toString()) ?? false);
|
||||
if (EnvConfig.logging.logRequests.charAt(0) == "-") skip = !skip;
|
||||
let skip = !(EnvConfig.get().logging.logRequests.includes(res.statusCode.toString()) ?? false);
|
||||
if (EnvConfig.get().logging.logRequests.charAt(0) == "-") skip = !skip;
|
||||
return skip;
|
||||
},
|
||||
}),
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import { centerString } from "@spacebar/extensions";
|
||||
import { getRevInfoOrFail, Logo, EnvConfig } from "@spacebar/util";
|
||||
import { initStats } from "./stats";
|
||||
|
||||
const cores = EnvConfig.threads;
|
||||
const cores = EnvConfig.get().threads;
|
||||
|
||||
if (cluster.isPrimary) {
|
||||
const revInfo = getRevInfoOrFail();
|
||||
|
||||
Reference in new issue
Block a user