Migrated auth to Nitro
This commit is contained in:
1 parent
27feb1ce95
commit
eb4e9f0700
16 files changed
+517
-129
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import type { H3Event } from "h3"
|
||||
|
||||
/**
|
||||
* Read private backend settings at runtime. Nuxt's NUXT_* runtime overrides
|
||||
* take precedence, while existing standalone-backend variable names remain
|
||||
* usable during the migration.
|
||||
*/
|
||||
export function getBackendRuntimeConfig(event?: H3Event) {
|
||||
const config = useRuntimeConfig(event)
|
||||
|
||||
return {
|
||||
mongodbUri: config.mongodbUri || process.env.MONGODB_URI || "",
|
||||
uploadDir: config.uploadDir || process.env.UPLOAD_DIR || "",
|
||||
tokenExpire: config.tokenExpire || process.env.TOKEN_EXPIRE || "1h",
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user