Documentation Suggestion: Exposing the API Port
- Vorherrschende Sprache
- Go
- Sterne
- 1.2k
- Forks
- 69
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I was looking for monitoring solution with an API I could access and use in my own project's. Peekaping is great for this purpose but the only thing is the documentation currently doesn't mention how to expose the API anywhere when running it in a Docker container. Took me awhile to figure it out but it was so easy and I think it should definitely be part of the documentation. If you want to expose the API just add port 8034 to the docker container its ports and after that the entire API is available at localhost:8034/api/v1/ and the docs are viewable at localhost:8034/swagger/index.html.
Docker Command:
`docker run -d --restart=always \
-p 8383:8383 \
-p 8034:8034 \
-e DB_NAME=/app/data/peekaping.db \
-v $(pwd)/.data/sqlite:/app/data \
--name peekaping \
0xfurai/peekaping-bundle-sqlite:latest`
At first I was completely confused and thought I had to run a dev server for this. But if you just want to access the API without changing anything to Peekaping itself exposing the port is all you have to do really. Here an example of an ESP32 based display fetching the latest heartbeat of a monitor(using one monitor for all 8 services as a proof of concept):

Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Find the Docker-related documentation, likely in a README.md or docs/ directory. Look for existing instructions on running the Docker container. Add a note about exposing port 8034 to access the API and Swagger UI, using the example command provided in the issue. Verify the change by checking the rendered documentation locally.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- docker, go
- Bereich
- api, devops, documentation
- Issue-Typ
- Dokumentation
- Schwierigkeit
- 1/5
- Geschätzter Aufwand
- Unter einer Stunde
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 80/100