Initial commit

This commit is contained in:
Jennie Robinson Faber 2025-11-11 19:12:21 +00:00
commit 92e96b9107
85 changed files with 24969 additions and 0 deletions

View file

@ -0,0 +1,20 @@
import mongoose from "mongoose";
export default defineNitroPlugin(async () => {
const config = useRuntimeConfig();
try {
await mongoose.connect(config.mongodbUri as string);
console.log("✓ MongoDB connected successfully");
} catch (error) {
console.error("✗ MongoDB connection error:", error);
throw error;
}
// Graceful shutdown
process.on("SIGINT", async () => {
await mongoose.connection.close();
console.log("MongoDB connection closed");
process.exit(0);
});
});