Add uptime route
This commit is contained in:
parent
7b0e2763ff
commit
531c5a7a68
@ -26,7 +26,7 @@ Proc file responses
|
||||
-------------
|
||||
|
||||
* returns uptime and idle time
|
||||
* Same as /proc/uptime
|
||||
* Same as /proc/uptime file
|
||||
|
||||
Sample response
|
||||
|
||||
@ -41,11 +41,17 @@ Sample response
|
||||
-------------------
|
||||
|
||||
* returns infomration regarding system memory
|
||||
* Same as /proc/meminfo
|
||||
* All responses are in kB
|
||||
* Same as /proc/meminfo file
|
||||
|
||||
Special formatted responses
|
||||
===========================
|
||||
|
||||
[GET] /uptime
|
||||
-------------
|
||||
|
||||
* Returns a redirect to /proc/uptime
|
||||
|
||||
[GET] /load
|
||||
----------
|
||||
|
||||
|
@ -41,6 +41,12 @@ void setRoutes(crow::SimpleApp& app){
|
||||
}
|
||||
});
|
||||
|
||||
CROW_ROUTE(app, "/uptime")([](){
|
||||
crow::response ret;
|
||||
ret.moved_perm("/proc/uptime");
|
||||
return ret;
|
||||
});
|
||||
|
||||
CROW_ROUTE(app, "/mem")([]{
|
||||
return "mem";
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user