20 lines
450 B
TypeScript
Executable File
20 lines
450 B
TypeScript
Executable File
import { SECRET_DB_URI } from "$env/static/private";
|
|
import mongoose from "mongoose";
|
|
|
|
import Playerdb from "./Userdb";
|
|
|
|
class DB {
|
|
dbs: any;
|
|
players: Playerdb;
|
|
constructor() {
|
|
this.players = new Playerdb();
|
|
this.connect();
|
|
}
|
|
|
|
connect() {
|
|
mongoose.set('strictQuery', true);
|
|
mongoose.connect(SECRET_DB_URI).then(() => { console.log("Connected to DataBase") });
|
|
}
|
|
}
|
|
|
|
export const db = new DB(); |