1
0
mirror of synced 2025-02-08 15:28:14 +01:00
Bayshore/src/config.ts

21 lines
441 B
TypeScript
Raw Normal View History

import fs from 'fs';
export interface ConfigFile {
shopName: string;
shopNickname: string;
}
export class Config {
private static cfg: ConfigFile;
static load() {
console.log('Loading config file...');
let cfg = fs.readFileSync('./config.json', 'utf-8');
let json = JSON.parse(cfg);
this.cfg = json as ConfigFile;
}
static getConfig(): ConfigFile {
return this.cfg;
}
}