mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
address breaking changes
This commit is contained in:
committed by
Thomas Ruoff
parent
8222e04880
commit
ef7f80fd92
@@ -7,18 +7,12 @@ let connectedPromise: Promise<mongoose.Mongoose>
|
||||
|
||||
export const MONGO_URI = process.env.MONGO_URI
|
||||
|
||||
export const MONGODB_OPTIONS = {
|
||||
useCreateIndex: true,
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true,
|
||||
}
|
||||
|
||||
export function connect(): Promise<mongoose.Mongoose> {
|
||||
if (connectedPromise) {
|
||||
return connectedPromise
|
||||
}
|
||||
|
||||
connectedPromise = mongoose.connect(process.env.MONGO_URI, MONGODB_OPTIONS)
|
||||
connectedPromise = mongoose.connect(process.env.MONGO_URI)
|
||||
|
||||
return connectedPromise
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user