0xfurai / 0xfurai/peekaping

Documentation Suggestion: Exposing the API Port

未关闭 适合新手
#244 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
1.2k
派生
69
PR 合并指标
30 天内没有已合并 PR

描述

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](https://github.com/user-attachments/assets/c4e82fce-adb9-4f99-aecf-ad3f131138e8)

贡献指南

这个仓库没有索引到贡献指南

调研方向

找到与 Docker 相关的文档,可能在 README.md 文件或 docs/ 目录中。查找现有的运行 Docker 容器的说明。添加一条关于暴露端口 8034 以访问 API 和 Swagger UI 的注释,使用 issue 中提供的示例命令。通过本地检查渲染后的文档来验证更改。

由索引模型根据 Issue 内容生成。

评估

技术栈
docker, go
领域
api, devops, documentation
Issue 类型
文档
难度
1/5
预计耗时
1 小时以内
活跃度
停滞
描述清晰度
描述清楚
新手友好度
80/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。