Skip to content

Documentation Suggestion: Exposing the API Port #244

@CollinKasbergen

Description

@CollinKasbergen

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):

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions