Skip to content

Commit ed0b45d

Browse files
committed
Add FAQ entry for /healthz
1 parent f770cd7 commit ed0b45d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/FAQ.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- [How does code-server decide what workspace or folder to open?](#how-does-code-server-decide-what-workspace-or-folder-to-open)
2020
- [How do I debug issues with code-server?](#how-do-i-debug-issues-with-code-server)
2121
- [Heartbeat File](#heartbeat-file)
22+
- [Healthz endpoint](#healthz-endpoint)
2223
- [How does the config file work?](#how-does-the-config-file-work)
2324
- [Blank screen on iPad?](#blank-screen-on-ipad)
2425
- [Isn't an install script piped into sh insecure?](#isnt-an-install-script-piped-into-sh-insecure)
@@ -240,6 +241,20 @@ If you want to shutdown `code-server` if there hasn't been an active connection
240241
you can do so by continuously checking the last modified time on the heartbeat file and if it is
241242
older than X minutes, kill `code-server`.
242243

244+
## Healthz endpoint
245+
246+
`code-server` exposes an endpoint at `/healthz` which can be used to check
247+
whether `code-server` is up without triggering a heartbeat. The response will
248+
include a status (`alive` or `expired`) and a timestamp for the last heartbeat
249+
(defaults to `0`).
250+
251+
```json
252+
{
253+
"status": "alive",
254+
"lastHeartbeat": 1599166210566,
255+
}
256+
```
257+
243258
[#1636](https://github.com/cdr/code-server/issues/1636) will make the experience here better.
244259

245260
## How does the config file work?

0 commit comments

Comments
 (0)