1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-25 19:52:36 +01:00
This commit is contained in:
Flam3rboy 2021-02-05 15:19:32 +01:00
parent 9b3209efd5
commit d4a89cae8a
2 changed files with 33 additions and 0 deletions

30
src/Config.ts Normal file
View File

@ -0,0 +1,30 @@
import "missing-native-js-functions";
import db from "./Database";
import { ProviderCache } from "lambert-db";
var Config: ProviderCache;
export default {
init: async function init(opts: DefaultOptions = DefaultOptions) {
Config = db.data.config({}).cache();
await Config.init();
await Config.set(opts.merge(Config.cache || {}));
},
getAll: function get() {
return <DefaultOptions>Config.get();
},
setAll: function set(val: any) {
return Config.set(val);
},
};
export interface DefaultOptions {
api: any;
gateway: any;
voice: any;
}
export const DefaultOptions: DefaultOptions = {
api: {},
gateway: {},
voice: {},
};

3
src/Constants.ts Normal file
View File

@ -0,0 +1,3 @@
import { VerifyOptions } from "jsonwebtoken";
export const JWTOptions: VerifyOptions = { algorithms: ["HS256"] };