36 lines
No EOL
720 B
TypeScript
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
|
|
} |