You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

26 lines
563 B

/**
* Changing the Database Provider
* This design allows for easy swapping of different database implementations.
*/
import LowDb from '~~/services/database/lowdb';
const nullObject = new Proxy(
{},
{
get() {
throw new Error('Database not yet initialized');
},
}
);
// eslint-disable-next-line import/no-mutable-exports
let provider = nullObject as never as LowDb;
LowDb.connect().then((v) => {
provider = v;
WireGuard.Startup();
});
// TODO: check if old config exists and tell user about migration path
export default provider;