@rpcbase/api 0.23.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/loadModel.ts +2 -2
package/package.json
CHANGED
package/src/loadModel.ts
CHANGED
|
@@ -5,7 +5,7 @@ import mongoose from "mongoose"
|
|
|
5
5
|
import { Ctx } from "./types"
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
const { APP_NAME,
|
|
8
|
+
const { APP_NAME, DB_PORT } = process.env
|
|
9
9
|
const connections: Record<string, mongoose.Connection> = {}
|
|
10
10
|
|
|
11
11
|
// @ts-expect-error: Property 'glob' does not exist on type 'ImportMeta'.
|
|
@@ -45,7 +45,7 @@ export const loadModel = async (modelName: string, ctx: Ctx) => {
|
|
|
45
45
|
? `${APP_NAME}-users-db`
|
|
46
46
|
: `${APP_NAME}-${tenantId}-db`
|
|
47
47
|
|
|
48
|
-
const connectionString = `mongodb://localhost:${
|
|
48
|
+
const connectionString = `mongodb://localhost:${DB_PORT}/${dbName}`
|
|
49
49
|
|
|
50
50
|
if (!connections[dbName]) {
|
|
51
51
|
const connection = mongoose.createConnection(connectionString, {
|