Skip to content

Commit

Permalink
Sanitize all code blocks on modified files
Browse files Browse the repository at this point in the history
  • Loading branch information
Tit Petric authored and letzya committed Mar 28, 2024
1 parent dfafc30 commit 66af1a7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ aliases:
---

In order to activate middleware when using Tyk OSS or when using a file-based setup, the middleware needs to be registered as part of your API Definition. Registration of middleware components is relatively simple.

{{< note success >}}
**Note**

It is important that your object names are unique.
{{< /note >}}{{< note success >}}
{{< /note >}}

{{< note success >}}
**Note**

This functionality may change in subsequent releases.
Expand All @@ -32,9 +35,7 @@ You can do this by setting `enable_jsvm` to `true` in your `tyk.conf` file.

Adding the middleware plugin is as simple as adding it to your definition file in the middleware sections:

```yaml
// sample_api.conf

```json
...
"event_handlers": {},
"custom_middleware": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A second method of loading API Definitions in Tyk nodes is to add them as a dire

The directory structure looks as follows:

```{.copyWrapper}
```text
middleware
/ {API Id}
/ pre
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Tyk will load the middleware plugins dynamically on host-reload without needing

The directory structure should look like this:

```{.copyWrapper}
```text
middleware
/ {API Id}
/ pre
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Below is the list of functions currently provided by Tyk.
- `TykBatchRequest` this function is similar to `TykMakeHttpRequest` but makes use of the Tyk Batch API. See the Batch Requests section of the [Tyk Gateway API]({{< ref "tyk-gateway-api" >}}) for more details.
- `TykMakeHttpRequest(JSON.stringify(requestObject))`: This method is used to make an HTTP request, requests are encoded as JSON for deserialisation in the min binary and translation to a system HTTP call. The request object has the following structure:

```{.javascript}
```js
newRequest = {
"Method": "POST",
"Body": JSON.stringify(event),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The `responseObject` has the following structure:
You must provide the `responseObject` together with the `session.meta_data` as parameters in a call to `TykJsResponse` as follows:

```js
return TykJsResponse(responseObject, session.meta_data);
return TykJsResponse(responseObject, session.meta_data);
```

You can find some examples of how this works [here]({{< ref "advanced-configuration/compose-apis/demo-virtual-endpoint" >}}).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The `virtual` object has the following configuration:

For example:

```json {linenos=true, linenostart=1}
```json {linenos=true, linenostart=1}
{
"extended_paths": {
"virtual": [
Expand Down

0 comments on commit 66af1a7

Please sign in to comment.