mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
fix mongodb templates and add migrate and generate scripts
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import mongoose from 'mongoose';
|
||||
import mongoose from "mongoose";
|
||||
|
||||
await mongoose.connect(process.env.DATABASE_URL || "");
|
||||
const client = mongoose.connection.getClient();
|
||||
await mongoose.connect(process.env.DATABASE_URL || "").catch((error) => {
|
||||
console.log("Error connecting to database:", error);
|
||||
});
|
||||
|
||||
export { client };
|
||||
const client = mongoose.connection.getClient().db("myDB");
|
||||
|
||||
export { client };
|
||||
|
||||
Reference in New Issue
Block a user