t00-multiuser/server/objects/Config.ts

41 lines
No EOL
809 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;
public static badge:ConfigBadge = config.badge;
}
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
}
interface ConfigBadge {
key: string
}