Vscode-restclient: Add [%]envVarName option to {{$dotenv}}

Created on 6 Feb 2020  路  4Comments  路  Source: Huachao/vscode-restclient

It would be great if it were possible to use an [%]envVarName option with {{dotenv}} in the same way that {{$processEnv}} [%]envVarName works. This would allow .env files to include values for multiple REST Client environments.

For example:

settings.json

  "rest-client.environmentVariables": {
    "$shared": {},
    "local": {
      "esUri": "http://localhost:9200",
      "esUser": "elastic",
      "esPass": "LOCALSECRET"
    },
    "dev": {
      "esUri": "http://dev.example.com:9201",
      "esUser": "root",
      "esPass": "DEVSECRET"
    },

.env

LOCALSECRET=changeme
DEVSECRET=ljqoie924

elasticsearch.http

### cluster health
GET {{esUri}}/_cluster/health?pretty=true
Authorization: Basic {{esUser}} {{$dotenv %esPASS}}
enhancement

Most helpful comment

@mchelen maybe some time this week

All 4 comments

@mchelen I have supported this and will publish this in the next release

Any chance of a new release being published soon? Really excited to have this feature available for our team!

@mchelen maybe some time this week

@mchelen you can try this in the latest version 0.23.2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fed29 picture Fed29  路  13Comments

ryan-ju picture ryan-ju  路  17Comments

Odonno picture Odonno  路  22Comments

symbioticKid picture symbioticKid  路  28Comments

jianwu picture jianwu  路  13Comments