t00-multiuser/server/objects/Config.ts
2024-07-03 23:47:45 +01:00

36 lines
No EOL
720 B
TypeScript

import { readFileSync } from "fs";
const config = JSON.parse(readFileSync("./config.json").toString());
export default abstract class Config {
public static ports:ConfigPorts = config.ports;
public static session:ConfigSession = config.session;
public static githost:string = config.githost;
public static database:ConfigDatabase = config.database;
}
interface ConfigPorts {
http: number,
ws: number,
metrics: number
}
interface ConfigSession {
validity: number,
length: number,
secret: string
}
interface ConfigDatabase {
address: string,
port: number,
username: string,
password: string,
name: string,
pbkdf2: DatabasePbkdf2
}
interface DatabasePbkdf2 {
itterations: number,
keylength: number
}