mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[GH-ISSUE #1629] Helper Module Request- .env environment variable check #515
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#515
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bhavukkalra on GitHub (May 6, 2021).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1629
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 ?
@liyasthomas commented on GitHub (May 6, 2021):
@AndrewBastin what do you think? I can't find any implications with this flexibility in Hoppscotch as of now.
@AndrewBastin commented on GitHub (May 6, 2021):
Umm, we already have
process.env.CONTEXTexposed to the app which allows you to check whether the app is running on dev mode or production.If that is not what you meant ? Can you elaborate more ?
@bhavukkalra commented on GitHub (May 7, 2021):
I actually was trying to reproduce the development environment on my local machine and was following the
.env.examplefor entering my own firebase credentials, which I did and got the app running but I seem to be having difficulties finding thisCONTEXTvariable in the.env.examplefile in the root directory as it didn't specified the usage of theCONTEXTvariable. 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
contextis a variable injected by Nuxt in to the whole to use .env variables defined on server side