EUS/objects/Config.ts
2025-01-05 14:22:18 +00:00

50 lines
No EOL
957 B
TypeScript

import { readFileSync } from "fs";
const config = JSON.parse(readFileSync("./config.json").toString());
export default abstract class Config {
public static instance: string = config.instance;
public static hosts: IHosts = config.hosts;
public static database: IDatabase = config.database;
public static session: ISession = config.session;
public static controllers: IControllers = config.controllers;
public static accounts: IAccounts = config.accounts;
}
interface IHosts {
webHost: string,
webPort: number
}
interface IDatabase {
enabled: boolean,
address: string,
port: number,
username: string,
password: string,
name: string
}
interface ISession {
secret: string,
validity: number,
length: number
}
interface IControllers {
enabled: boolean
}
interface ISignup {
enabled: boolean,
key: string | null
}
interface IPbkdf2 {
itterations: number,
keylength: number
}
interface IAccounts {
signup: ISignup,
pbkdf2: IPbkdf2
}