refactor(nuxt): add db name to runtime config

This commit is contained in:
parent 417fda7617
commit fe44a461ea
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

@ -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 =
<T>() =>
<U extends T>(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,