Skip to content

Commit

Permalink
Improving tutorials, examples, documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lovestaco committed Jul 22, 2023
1 parent cf75f06 commit cfe3773
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/Lama2/docs/tutorials/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
1 change: 1 addition & 0 deletions docs/Lama2/docs/tutorials/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file added docs/Lama2/docs/tutorials/l2configAtRoot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Lama2/docs/tutorials/l2env.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/Lama2/docs/tutorials/l2envOverideL2config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions examples/0022_l2config_declare/api/0022_l2config_declare.l2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GET
${AHOST}/get
2 changes: 2 additions & 0 deletions examples/0022_l2config_declare/l2config.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export AHOST=`echo NO URL`
export BHOST="https://httpbin.org"
2 changes: 2 additions & 0 deletions examples/0023_l2env_declare/0023_l2env_declare.l2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GET
${AHOST}/get
1 change: 1 addition & 0 deletions examples/0023_l2env_declare/l2.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export AHOST=`echo http://httpbin.org`

0 comments on commit cfe3773

Please sign in to comment.