You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a possibility to add Helper Module to the Helper's Directory which checks the current environment upon which the work is being done.
The env file could have a variable APP_ENV , which could take values "production", "development", "undefined"(If Nothing is provided)
The code for the test and configuring the .env path could look something like this(The file will reside in the helpers directory, which could improve the quality of life for local Development)
./helpers/envHandler.js
importdotenvfrom'dotenv'dotenv.config({path: `${__dirname}/.env`})constenv=process.env.APP_ENVconsole.log(`Testing for: ${env}`)try{switch(env){case'undefined':
Error('Environment undefined, if local in terminal: export APP_ENV=development')breakcase'development':
console.log('SAFE: The App is running in development enviroment')breakcase'production':
console.log('ALERT: The App is running in Production Enviroment')breakdefault:
Error('Unrecognized Environment')}}catch(err){Error('Error trying to run file')}
Does it add any value to the current Repository/Architecture ?
The text was updated successfully, but these errors were encountered:
I actually was trying to reproduce the development environment on my local machine and was following the .env.example for entering my own firebase credentials, which I did and got the app running but I seem to be having difficulties finding this CONTEXT variable in the .env.examplefile in the root directory as it didn't specified the usage of the CONTEXT variable. Am i overlooking something here?
This issue can be closed as @AndrewBastin explained earlier, this variable is already already there.
EDIT - Just got to know that context is a variable injected by Nuxt in to the whole to use .env variables defined on server side
Is there a possibility to add Helper Module to the Helper's Directory which checks the current environment upon which the work is being done.
The env file could have a variable APP_ENV , which could take values "production", "development", "undefined"(If Nothing is provided)
The code for the test and configuring the .env path could look something like this(The file will reside in the helpers directory, which could improve the quality of life for local Development)
./helpers/envHandler.js
Does it add any value to the current Repository/Architecture ?
The text was updated successfully, but these errors were encountered: