From 5e6b1d8cf7d1721501db0879b30d08cc8f2d2623 Mon Sep 17 00:00:00 2001 From: Joel Funk Persson Date: Wed, 25 Oct 2023 14:51:25 +0200 Subject: [PATCH] use env for database name --- src/db/database.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db/database.ts b/src/db/database.ts index 5e450cd..f5ca566 100644 --- a/src/db/database.ts +++ b/src/db/database.ts @@ -7,7 +7,7 @@ async function startDb() { uri = process.env.MONGO_URI_TEST; } - await mongoose.connect(uri, { dbName: "trains" }); + await mongoose.connect(uri, { dbName: process.env.DATABASE_NAME ?? "trains" }); } export default startDb;