mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
add mongo adapter via mongoose
This commit is contained in:
committed by
Thomas Ruoff
parent
c2bd8f8d01
commit
8dd0c7b9b2
@@ -3,11 +3,11 @@ import BookingModel, { Booking, BookingDocument } from './booking'
|
||||
import BillModel, { Bill } from './bill'
|
||||
import { BOOKING_STATUS } from './enums'
|
||||
|
||||
let connectedPromise: Promise<typeof mongoose>
|
||||
let connectedPromise: Promise<mongoose.Mongoose>
|
||||
|
||||
function connect(): Promise<typeof mongoose> {
|
||||
export function connect(): Promise<mongoose.Mongoose> {
|
||||
if (connectedPromise) {
|
||||
return
|
||||
return connectedPromise
|
||||
}
|
||||
|
||||
connectedPromise = mongoose.connect(process.env.MONGO_URI, {
|
||||
|
||||
Reference in New Issue
Block a user