Add heartbeat to API

This commit is contained in:
prpr 2025-01-28 20:08:49 +00:00
parent 8da619ded7
commit 7293ae2c87

17
webif/html/api/heartbeat.jim Executable file
View File

@ -0,0 +1,17 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
require system.class
package require json
httpheader {application/json}
set time [clock milliseconds]
catch {
lappend vars \
isotime [system isotime $time] \
timestamp $time \
uptime [system uptime]
puts [json::encode $vars obj]
}