diff --git a/docs/Lama2/docs/tutorials/examples.md b/docs/Lama2/docs/tutorials/examples.md index e6adcf1e..9c5203d8 100644 --- a/docs/Lama2/docs/tutorials/examples.md +++ b/docs/Lama2/docs/tutorials/examples.md @@ -85,6 +85,10 @@ export LOCAL="http://localhost:8000" export REMOTE="http://httpbin.org" ``` +![l2.env at API level](l2env.png) + +Get [Source File](https://github.com/HexmosTech/Lama2/tree/main/examples/0023_l2env_declare) + ### Case 2: Root variables In Lama2, you can have a large number of API files stored in a hierarchical folder configuration. @@ -97,11 +101,17 @@ Within such a structure, you can have an API file anywhere, which can use variab export LOCAL="http://localhost:8000" export REMOTE="http://httpbin.org" ``` +![l2config.env at Project root level](l2configAtRoot.png) + +Get [Source File](https://github.com/HexmosTech/Lama2/tree/main/examples/0022_l2config_declare) ### Case 3: Override Root variable with local variable +In this structure, if a variable is declared in both l2config.env and l2.env, the value from l2.env takes precedence. ![Override of l2config.env with l2.env variable](l2envOverideL2config.png) +Get [Source File](https://github.com/HexmosTech/Lama2/tree/main/examples/0020_override_project_root_local) + ## Headers Use `key:value` format to specify headers. diff --git a/docs/Lama2/docs/tutorials/installation.md b/docs/Lama2/docs/tutorials/installation.md index 87fe90db..84419ec8 100644 --- a/docs/Lama2/docs/tutorials/installation.md +++ b/docs/Lama2/docs/tutorials/installation.md @@ -90,6 +90,7 @@ Application Options: -o, --output= Path to output JSON file to store logs, headers and result -v, --verbose Show verbose debug information -n, --nocolor Disable color in httpie output + -e --env Get a JSON of environment variables -h, --help Usage help for Lama2 --version Print Lama2 binary version diff --git a/docs/Lama2/docs/tutorials/l2configAtRoot.png b/docs/Lama2/docs/tutorials/l2configAtRoot.png new file mode 100644 index 00000000..7ca55e51 Binary files /dev/null and b/docs/Lama2/docs/tutorials/l2configAtRoot.png differ diff --git a/docs/Lama2/docs/tutorials/l2env.png b/docs/Lama2/docs/tutorials/l2env.png new file mode 100644 index 00000000..a9a98e1c Binary files /dev/null and b/docs/Lama2/docs/tutorials/l2env.png differ diff --git a/docs/Lama2/docs/tutorials/l2envOverideL2config.png b/docs/Lama2/docs/tutorials/l2envOverideL2config.png index df8b877f..541a2db6 100644 Binary files a/docs/Lama2/docs/tutorials/l2envOverideL2config.png and b/docs/Lama2/docs/tutorials/l2envOverideL2config.png differ diff --git a/examples/0022_l2config_declare/api/0022_l2config_declare.l2 b/examples/0022_l2config_declare/api/0022_l2config_declare.l2 new file mode 100644 index 00000000..eeea2a10 --- /dev/null +++ b/examples/0022_l2config_declare/api/0022_l2config_declare.l2 @@ -0,0 +1,2 @@ +GET +${AHOST}/get \ No newline at end of file diff --git a/examples/0022_l2config_declare/l2config.env b/examples/0022_l2config_declare/l2config.env new file mode 100644 index 00000000..02744d12 --- /dev/null +++ b/examples/0022_l2config_declare/l2config.env @@ -0,0 +1,2 @@ +export AHOST=`echo NO URL` +export BHOST="https://httpbin.org" \ No newline at end of file diff --git a/examples/0023_l2env_declare/0023_l2env_declare.l2 b/examples/0023_l2env_declare/0023_l2env_declare.l2 new file mode 100644 index 00000000..eeea2a10 --- /dev/null +++ b/examples/0023_l2env_declare/0023_l2env_declare.l2 @@ -0,0 +1,2 @@ +GET +${AHOST}/get \ No newline at end of file diff --git a/examples/0023_l2env_declare/l2.env b/examples/0023_l2env_declare/l2.env new file mode 100644 index 00000000..2a9324b2 --- /dev/null +++ b/examples/0023_l2env_declare/l2.env @@ -0,0 +1 @@ +export AHOST=`echo http://httpbin.org` \ No newline at end of file