Uh oh!
There was an error while loading. Please reload this page.
Replies: 1 comment
Nitro loads The recommended pattern:
// nitro.config.tsexportdefaultdefineNitroConfig({runtimeConfig: {mySecret: '',// private, server-onlypublic: {apiBase: '/api',// accessible client-side too (Nuxt)},},});
constconfig=useRuntimeConfig();console.log(config.mySecret);// the value from envThe key is the naming convention: If you specifically need to load a |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I see you using c12 and dotenv (installed but never used in code as far as I can see) but I can't get the .env file to load in config, the only way that work is to add an extends with a ts file
What ways I can load .env file into Nitro?
All reactions