From 911a8775bb7e40985770f217dfd4038da8bab9be 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: Sat, 16 Mar 2024 21:02:22 -0400 Subject: [PATCH] refactor(nuxt): move nuxt runtime config to separate exported variable --- lib/server/constants.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/lib/server/constants.ts b/lib/server/constants.ts index 27bcb67..f136a20 100644 --- a/lib/server/constants.ts +++ b/lib/server/constants.ts @@ -1,4 +1,5 @@ import turndown from "turndown"; +import { RuntimeConfig } from "nuxt/schema"; export const ContentFilenameRegex = /\.(doc|docx|md|markdown)$/i; export const emailRegex: RegExp = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; @@ -112,3 +113,32 @@ export const h2m = new turndown({ emDelimiter: "*", bulletListMarker: "+", }); + +export const rc: RuntimeConfig & any = { + captcha: { + secret: process.env.CAPTCHASECRET, + key: process.env.CAPTCHAKEY, + }, + database: { + user: process.env.DBUSER, + password: process.env.DBPASS, + name: process.env.DBNAME, + uri: `mongodb://${process.env.DB}`, + }, + jwt: process.env.JWT, + public: { + recaptcha: { + v2SiteKey: process.env.CAPTCHAKEY, + }, + auth: { + computed: { + origin: "127.0.0.1", + }, + }, + // apiBase: "/api" + }, + nodebb: { + masterToken: process.env.nbb_bearer, + }, + app: {}, +};