Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ztroop committed Feb 24, 2024
1 parent c8dcdb7 commit 4725fce
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ Options:

## Configuration

Each item in the list (denoted by a dash -) represents a configuration for an API endpoint. Each endpoint configuration consists of several key-value pairs that define its properties. Here's what each key represents:

- `name` - A human-readable identifier for the endpoint. It's used for reference and doesn't affect the endpoint's functionality.
- `endpoint` - The URI path that the endpoint responds to. This is the part of the URL that follows your domain or base URL.
- `method` - (Optional) Specifies the HTTP method (e.g., GET, POST) the endpoint should respond to. It defines the type of operation you want to perform.
- `data` - (Optional) Contains the data that the endpoint will send back in the response. This section is structured as nested key-value pairs, representing the response body. It's typically used with methods like POST or PUT that involve sending data.
- `status` - The HTTP status code that the endpoint will return. It indicates the result of the request (e.g., 200 for success, 404 for not found).
- `headers` - (Optional) Specifies any additional HTTP headers that the response will include. Headers are often used for specifying the content type or for authentication.

See [EXAMPLES](./examples/) for sample configuration files.
Each item in the list represents a configuration for an API endpoint. Each endpoint configuration consists of several key-value pairs that define its properties. Here's what each key represents:

|Field|Default|Description|
|-----|-------|-----------|
|`name`|Required|A human-readable identifier for the endpoint. It's used for reference and doesn't affect the endpoint's functionality.|
|`endpoint`|Required|The URI path that the endpoint responds to. This is the part of the URL that follows your domain or base URL.|
|`method`|`GET`|Specifies the HTTP method (e.g., GET, POST) the endpoint should respond to. It defines the type of operation you want to perform.|
|`status`|`200`|The HTTP status code that the endpoint will return. It indicates the result of the request (e.g., 200 for success, 404 for not found).|
|`headers`|`None`|Specifies any additional HTTP headers that the response will include. Headers are often used for specifying the content type or for authentication.|
|`data`|`None`|Specifies the response data. It has two keys: `format` and `payload`.|
|`data.format`|`json`|Options: `json`, `xml` and `text`.|
|`data.payload`|`null`|Specifies either a string literal or key-value pairs.|

See [EXAMPLES](./examples/) for a configuration sample.

0 comments on commit 4725fce

Please sign in to comment.