Skip to content

Commit

Permalink
Update error_file documentation #59
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Ludwig committed Nov 9, 2020
1 parent 8c41667 commit 54be7b5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ It has an optional label and a `hosts` attribute. Nested blocks are `files`, `sp
|context|none|
| *label*|optional|
| `hosts`|<ul><li>list </li><li>&#9888; mandatory, if there is more than one `server` block</li><li>*example:*`hosts = ["example.com", "..."]`</li><li>you can add a specific port to your host <br> *example:* `hosts = ["localhost:9090"]` </li><li>default port is `8080`</li><li>only **one** `hosts` attribute per `server` block is allowed</li><li>compare the hosts [example](#hosts_conf_ex) for details</li></ul>|
| `error_file` | <ul><li>location of the error template file</li><li>*example:* `error_file = "./my_error_page.html" `</li></ul> |
|[**`access_control`**](#access_control_attribute)|<ul><li>sets predefined `access_control` for `server` block</li><li>*example:* `access_control = ["foo"]`</li><li>&#9888; inherited</li></ul>|
|[**`files`**](#fi) block|configures file serving|
|[**`spa`**](#spa) block|configures web serving for spa assets|
Expand All @@ -223,9 +224,9 @@ The `files` block configures your document root, and the location of your error
|:-------------------|:---------------------------------------|
|context|`server` block|
| *label*|optional|
| `document_root`|<ul><li>location of the document root</li><li>*example:* `document_root = "./htdocs"`</li></ul>|
|`error_file`|<ul><li>location of the error file</li><li>*example:* `error_file = "./404.html" `</li></ul>|
|[**`access_control`**](#access_control_attribute)|<ul><li>sets predefined `access_control` for `files` block context</li><li>*example:* `access_control = ["foo"]`</li></ul>|
| `document_root`| <ul><li>location of the document root</li><li>*example:* `document_root = "./htdocs"`</li></ul>|
| `error_file` | <ul><li>location of the error template file</li><li>*example:* `error_file = "./my_error_page.html" `</li></ul>|
| [**`access_control`**](#access_control_attribute) | <ul><li>sets predefined `access_control` for `files` block context</li><li>*example:* `access_control = ["foo"]`</li></ul>|

### The `spa` block <a name="spa_block"></a>
The `spa` block configures the location of your bootstrap file and your SPA paths.
Expand All @@ -240,12 +241,14 @@ The `spa` block configures the location of your bootstrap file and your SPA path

### The `api` block <a name="api_block"></a>
The `api` block contains all information about endpoints, and the connection to remote/local backend service(s) (configured in the nested `endpoint` and `backend` blocks). You can add more than one `api` block to a `server` block.
If an error occurred for api endpoints the response gets processed as json error with an error body payload. This can be customized via `error_file`.

| Name | Description |
|:-------------------|:---------------------------------------|
|context|`server` block|
|*label*|&#9888; mandatory, if there is more than one `api` block|
| `base_path`|<ul><li>optional</li><li>*example:* `base_path = "/api" `</li></ul>|
| `base_path`|<ul><li>optional</li><li>*example:* `base_path = "/api" `</li></ul> |
| `error_file` | <ul><li>location of the error template file</li><li>*example:* `error_file = "./my_error_body.json" `</li></ul> |
|[**`access_control`**](#access_control_attribute)|<ul><li>sets predefined `access_control` for `api` block context</li><li>&#9888; inherited by all endpoints in `api` block context</li></ul>|
|[**`backend`**](#backend_block) block|<ul><li>configures connection to a local/remote backend service for `api` block context</li><li>&#9888; only one `backend` block per `api` block<li>&#9888; inherited by all endpoints in `api` block context</li></ul>|
|[**`endpoint`**](#endpoint_block) block|configures specific endpoint for `api` block context|
Expand Down Expand Up @@ -408,7 +411,7 @@ api "my_api" {
server "my_project" {
files {
document_root = "./htdocs"
error_file = "./404.html"
error_file = "./my_custom_error_page.html"
}
spa {
bootstrap_file = "./htdocs/index.html"
Expand Down

0 comments on commit 54be7b5

Please sign in to comment.