diepm / vim-rest-console

A REST console for Vim.
658 stars 54 forks source link

Allow variables in `host` setting to allow quick switching between environments #15

Closed mjakl closed 8 years ago

mjakl commented 8 years ago

We are working with several (test) environments and it would be fantastic to easily switch between them by changing a single setting instead of search/replace through the whole file.

Since the http or https start the request block, maybe a viable option would be to allow variables to be used in the URL?

For example:

#ENVIRONMENT=api
ENVIRONMENT=test-api

https://$ENVIRONMENT.example.com
GET /debug/ping

By setting the right ENVITONMENT variable it'd be quick and easy to switch around between different setups and it would not interfere with existing VRC scripts.

mjakl commented 8 years ago

Maybe variable substitution would even make sense for the whole request block (thinking or Authorization headers with short lived tokens...).

CaptainQuirk commented 4 years ago

Hi @diepm ! Why was this issue closed ? The whole goal of being able to have variable schemes, host and port in the request block would be to switch environment without having to change the rest files themselves, especially if they are under version control. I don't unserstand how using a global host solves the issue :smile: !