subasraj / flashpost-support

Flashpost is a lightweight Rest API Client Extension for Visual Studio Code.
MIT License
10 stars 0 forks source link

(New Feature)support including values from .env file from the project #11

Closed BananaAcid closed 8 months ago

BananaAcid commented 9 months ago

.. so NODE_ENV = production (SERVER_URL and what not) can be used as variable directly

probably with an option: Enable automatic inclusion of '.env' file which would be injected before the environment values

subasraj commented 9 months ago

will you use this same variable format {{NODE_ENV}}

BananaAcid commented 9 months ago

I would then use it - if available.

Commonly .env files in node based projects hold a lot of configuration already. Not needing to copy paste all of it into the „environment“ tab each time something changes in the env file would be great.

subasraj commented 8 months ago

@BananaAcid I have made the change. Please try Flashpost version 1.1.55. I have also added a setting to control this .env see image below

image

subasraj commented 8 months ago

@BananaAcid Did you try this .env change? please let me know if you have tested it

BananaAcid commented 8 months ago

@subasraj Yes testet - works. Seems like it is case sensitive.

But: I had to reload the VSCode to get it to update the keys from the .env-file for the green highlighting in the URL. send worked right away. and it turned green after pressing send as well. Maybe something to optimize - but feature works!!!

subasraj commented 8 months ago

The .env file loading works when you open the request. For green highlighting close and open request tab.