Skip to content

Commit

Permalink
Add documentation #59
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Ludwig committed Oct 26, 2020
1 parent 3012d4c commit 94c4218
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Environment variables can be accessed everywhere within the configuration file s
| `headers.<name>` | HTTP request header value for requested lower-case key|
| `cookies.<name>` | value from `Cookie` request header for requested key (&#9888; last wins!)|
| `query.<name>` | query parameter values (&#9888; last wins!)|
| `path_param.<name>` value from a named path parameter defined within an endpoint path label |
| `post.<name>` | post form parameter|
| `ctx.<name>.<claim_name>` | request context containing claims from JWT used for [access control](#access_control_attribute), `<name>` being the [`jwt` block's](#jwt_block) label and `claim_name` being the claim's name|

Expand Down Expand Up @@ -269,6 +270,16 @@ Endpoints define the entry points of Couper. The mandatory *label* defines the p
|[**`access_control`**](#access_control_attribute)|sets predefined `access_control` for `endpoint`|
|[**`backend`**](#backend_block) block |configures connection to a local/remote backend service for `endpoint`|

#### Path parameter

An endpoint label could be defined as `endpoint "/app/{section}/{project}/view" { ... }` to access the named path parameter `section` and `project` via `req.path_param.*`.
The values would map as following for the request path: `/app/nature/plant-a-tree/view`:

| Variable | Value |
|:-------------------------|:---------------|
| `req.path_param.section` | `nature` |
| `req.path_param.project` | `plant-a-tree` |

### The `backend` block <a name="backend_block"></a>
A `backend` defines the connection to a local/remote backend service. Backends can be defined globally in the `api` block for all endpoints of an API or inside an `endpoint`. An `endpoint` must have (at least) one `backend`. You can also define backends in the `definitions` block and use the mandatory *label* as reference.

Expand Down

0 comments on commit 94c4218

Please sign in to comment.