From 7c8ea86d4ef8561bcf4e80f27449dc5d9c3d0799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferdinand=20M=C3=BCtsch?= Date: Sun, 6 Sep 2020 12:25:12 +0200 Subject: [PATCH] docs: document api endpoints in readme --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 2c88daa..ced6157 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,18 @@ INSERT INTO aliases (`type`, `user_id`, `key`, `value`) VALUES (0, 'your_usernam **NOTE:** In order for the aliases to take effect for non-live statistics, you would either have to wait 24 hours for the cache to be invalidated or restart Wakapi. +## API Endpoints +The following API endpoints are available. A more detailed Swagger documentation is about to come ([#40](https://github.com/muety/wakapi/issues/40)). + +* `POST /api/heartbeat` +* `GET /api/summary` + * `string` parameter `interval`: One of `today`, `day`, `week`, `month`, `year`, `any` + * `bool` parameter `live`: Whether to compute the summary to present time +* `GET /api/compat/v1/users/current/all_time_since_today` (see [Wakatime API docs](https://wakatime.com/developers#all_time_since_today)) +* `GET /api/compat/v1/users/current/summaries` (see [Wakatime API docs](https://wakatime.com/developers#summaries)) (⏳ [coming soon](https://github.com/muety/wakapi/issues/44)) +* `GET /api/health` + + ## Best Practices It is recommended to use wakapi behind a **reverse proxy**, like [Caddy](https://caddyserver.com) or _nginx_ to enable **TLS encryption** (HTTPS). However, if you want to expose your wakapi instance to the public anyway, you need to set `listen = 0.0.0.0` in `config.ini`