Expose process PID in API and UI

Include the process PID in the API info payload and surface it in the frontend. apiHandler now adds app.Info["pid"] = os.Getpid(); openapi.yaml documents the new pid property as an integer with an example; www/index.html is updated to show pid alongside version and config. This aids debugging and identifying the running process.
This commit is contained in:
Sergey Krashevich
2026-02-13 11:11:10 +03:00
parent f68c602a7d
commit ab80450b66
3 changed files with 8 additions and 1 deletions
+6 -1
View File
@@ -147,7 +147,12 @@
const url = new URL('api', location.href);
fetch(url, {cache: 'no-cache'}).then(r => r.json()).then(data => {
const info = document.querySelector('.info');
info.innerText = `version: ${data.version} / config: ${data.config_path}`;
const parts = [
`version: ${data.version}`,
`pid: ${data.pid}`,
`config: ${data.config_path}`,
];
info.innerText = parts.join(' / ');
});
reload();