21 lines
551 B
TypeScript
21 lines
551 B
TypeScript
import mongoose from "mongoose";
|
|
import { Biffno } from "~/models/challenges/biffno";
|
|
import { Ficmas } from "~/models/challenges/ficmas";
|
|
import { Challenge } from "~/models/challenges/gen";
|
|
|
|
export default async function () {
|
|
let beep = useRuntimeConfig();
|
|
Challenge;
|
|
Biffno;
|
|
Ficmas;
|
|
console.log(mongoose.connection.modelNames);
|
|
console.log(beep);
|
|
try {
|
|
await mongoose.connect(beep.database.uri);
|
|
// if (!!!mongoose.connections.length)
|
|
} catch (e) {
|
|
console.error(e);
|
|
throw createError({ statusCode: 500, message: "whoops." });
|
|
}
|
|
}
|