Skip to content

Commit ec4cc92

Browse files
committed
chore: add api docs server to control-plane-dev
Adds an API docs server to the `control-plane-dev` configuration. You'll be able to access the API documentation at `http://localhost:8999` when you run `make dev-watch`. Being able to view the API docs in this format makes it easier to review some parts of the generated OpenAPI spec, such as request and response examples. PLAT-86
1 parent 713706b commit ec4cc92

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

docker/control-plane-dev/docker-compose.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,11 @@ services:
4444
- PGEDGE_HTTP__PORT=3002
4545
- PGEDGE_EMBEDDED_ETCD__PEER_PORT=2580
4646
- PGEDGE_EMBEDDED_ETCD__CLIENT_PORT=2579
47+
api-docs:
48+
image: redocly/redoc
49+
ports:
50+
- 8999:80
51+
volumes:
52+
- ../../api/v1/gen/http:/usr/share/nginx/html/specs
53+
environment:
54+
- SPEC_URL=specs/openapi3.yaml

docs/running-locally-docker.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Control Plane cluster that runs in Docker via Docker Compose.
1414
- [Development workflow](#development-workflow)
1515
- [Rebuilding the `control-plane` binary](#rebuilding-the-control-plane-binary)
1616
- [Debugging](#debugging)
17+
- [API documentation](#api-documentation)
1718

1819
## Prerequisites
1920

@@ -183,3 +184,14 @@ This is an example remote debugging configuration for VSCode:
183184
```
184185

185186
After attaching the debugger, the server will start normally.
187+
188+
## API documentation
189+
190+
The `docker-compose.yaml` file for this configuration includes an API
191+
documentation server. You can access the documentation in your browser at
192+
http://localhost:8999.
193+
194+
This uses the OpenAPI spec from the `api/v1/gen` directory and generates the
195+
documentation on the client side. When you regenerate the OpenAPI spec, for
196+
example by running `make -C api generate`, you only need to refresh the page to
197+
see the updates.

0 commit comments

Comments
 (0)