# API Swagger-Documentation

The documentation of the API is available on `/api/swagger/index.html`

#### Example:

{% tabs %}
{% tab title="Docker" %}

```
docker run -d --name core -p 8080:8080 datarhei/core:latest
```

**Open:** <http://127.0.0.1:8080/api/swagger/index.html>
{% endtab %}

{% tab title="Golang" %}
To generate the API documentation from the code, use [swag](https://github.com/swaggo/swag):

{% code lineNumbers="true" %}

```
make init swagger
make run
```

{% endcode %}

After the first command the swagger definition can be found at `docs/swagger.json` or `docs/swagger.yaml`.

The second command will build the core binary and start it. With the default configuration, the Swagger UI is available at `http://localhost:8080/api/swagger/index.html`.
{% endtab %}
{% endtabs %}

#### Public demo:

{% embed url="<https://demo.datarhei.com/api/swagger/index.html>" %}
