Skip to content

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nmengin committed Jun 12, 2024
1 parent 9db389d commit 80eb15c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 6 additions & 6 deletions api-gateway/1-getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ kubectl apply -f src/kind/metallb-config.yaml

</details>

## Step 1: Install Traefik Hub API Gateway
### Step 1: Install Traefik Hub API Gateway

Log in to the [Traefik Hub Online Dashboard](https://hub.traefik.io), open the page to [generate a new agent](https://hub.traefik.io/agents/new).

Expand Down Expand Up @@ -124,7 +124,7 @@ helm upgrade traefik-hub -n traefik-hub --wait \

Now, we can access the local dashboard: http://dashboard.docker.localhost/

## Step 2: Deploy an API as an Ingress
### Step 2: Deploy an API as an Ingress

Without Traefik Hub API Gateway, an API can be deployed as an `Ingress`, an `IngressRoute` or an `HTTPRoute`.

Expand Down Expand Up @@ -189,7 +189,7 @@ curl http://api.docker.localhost/weather
}
```

## Step 3: Secure authentication on this API with Traefik Hub
### Step 3: Secure authentication on this API with Traefik Hub

Let's secure the weather API with an API Key.

Expand Down Expand Up @@ -283,7 +283,7 @@ git clone https://github.com/traefik/hub.git
cd hub
```

## Step 1: Install Traefik Hub API Gateway
### Step 1: Install Traefik Hub API Gateway

Get the Traefik Hub API Gateway binary:

Expand Down Expand Up @@ -360,7 +360,7 @@ sudo systemctl status traefik-hub.service

[...] systemd[1]: Started traefik-hub.service - Traefik Hub.
```
## Step 2: Expose an API
### Step 2: Expose an API

:information_source: On Linux, we can use all the providers supported by Traefik Proxy and Traefik Hub API Gateway.

Expand Down Expand Up @@ -455,7 +455,7 @@ X-Forwarded-Server: ip-172-31-26-184
X-Real-Ip: 127.0.0.1
```

## Step 3: Secure the access using an API Key
### Step 3: Secure the access using an API Key

Let's secure the access with an API Key.

Expand Down
7 changes: 4 additions & 3 deletions api-management/1-getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,15 @@ curl -H "Authorization: Bearer $ADMIN_TOKEN" http://api.docker.localhost/weather
}
```

:information_source: If it fails with 401, just wait one minute and try again. The token needs to be sync before it can be accepted by Traefik Hub.
:information_source: If it fails with 401, wait a minute and try again. The token needs to be sync before it can be accepted by Traefik Hub.

We can see the API available in the `apps` namespace in the portal. This first API does not come with an OpenAPI specification (OAS):

![API Portal without OAS](./images/api-portal-without-oas.png)

Although not setting an OAS for an API is possible, it severely hurts getting started with API consumption. Let's see what features are unlocked if we set one. Let's deploy a [forecast app](https://github.com/traefik/hub-preview/blob/main/src/manifests/weather-app-forecast.yaml) with an OpenAPI specification:
Although not setting an OAS for an API is possible, it severely hurts getting started with API consumption.
Let's see what features are unlocked if we set one.
Let's deploy a [forecast app](https://github.com/traefik/hub-preview/blob/main/src/manifests/weather-app-forecast.yaml) with an OpenAPI specification:

```shell
kubectl apply -f src/manifests/weather-app-forecast.yaml
Expand Down Expand Up @@ -389,4 +391,3 @@ ingressroute.traefik.io/weather-api-forecast created
And that's it! This time, we have documentation built from the OpenAPI specification, and we can also interactively try the API with the Try Out functionality.

![API Portal With OAS](./images/api-portal-with-oas.png)

0 comments on commit 80eb15c

Please sign in to comment.