Files
HumanDex/src/lib/ts/db.ts
2025-10-24 01:32:42 -04:00

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();