36 lines
No EOL
705 B
TypeScript
36 lines
No EOL
705 B
TypeScript
import { readFileSync } from "fs";
|
|
|
|
const config = JSON.parse(readFileSync("./config.json").toString());
|
|
|
|
export default class Config {
|
|
public constructor() { throw new Error("Static Class"); }
|
|
|
|
public static ports:ConfigPorts = config.ports;
|
|
public static session:ConfigSession = config.session;
|
|
public static database:ConfigDatabase = config.database;
|
|
}
|
|
|
|
interface ConfigPorts {
|
|
http: number,
|
|
ws: 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
|
|
} |