moved api from monorepo

This commit is contained in:
john-okeefe committed 2024-09-12 15:48:27 -04:00
1 parent 734bb0a0d2
commit d575a4efc5
29 files changed
+2904

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
import mongoose from 'mongoose'
const MONGO_URI =
Bun.env.NODE_ENV === 'development'
? Bun.env.MONGO_DEV_URI
: Bun.env.MONGO_URI
const connectDB = async () => {
mongoose.set('strictQuery', true)
const conn = await mongoose.connect(MONGO_URI)
console.log(
`MongoDB Connected to ${
conn.connection.host
} using ${conn.connection.name.toUpperCase()} database`.cyan.underline.bold
)
}
export default connectDB