diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 134107c..e01bc2d 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -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 ---------- diff --git a/src/routes.cpp b/src/routes.cpp index f73b92a..d1756a8 100644 --- a/src/routes.cpp +++ b/src/routes.cpp @@ -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"; });