From fe44a461eaf02ce56843608573c37d342a88ca84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Thu, 4 Jan 2024 20:50:29 -0500 Subject: [PATCH] refactor(nuxt): add db name to runtime config --- nuxt.config.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nuxt.config.ts b/nuxt.config.ts index c0f2c94..6ae74ce 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -15,6 +15,18 @@ const cac = { }, swr: false, }; + +const stor = { + db: { + driver: "mongodb", + connectionString: + process.env.NODE_ENV == "production" + ? `mongodb://${process.env.DBUSER}:${process.env.DBPASS}@localhost:27017/${process.env.DBNAME}` + : `mongodb://localhost:27017/${process.env.DBNAME}`, + databaseName: process.env.DBNAME, + collectionName: "cache", + }, +}; const ct = () => (u: U) => @@ -135,6 +147,7 @@ export default defineNuxtConfig({ database: { user: process.env.DBUSER, password: process.env.DBPASS, + name: process.env.DBNAME, uri: `mongodb://${process.env.DB}`, }, jwt: process.env.JWT,