Rework dashboard

This commit is contained in:
Sergey Lyubka committed 2022-06-05 14:59:59 +01:00
1 parent cac7f653c9
commit 31c7d66245
7 files changed
+1104 -920

No files matched your search

+5 -3
View File
@@ -2,15 +2,17 @@
// All rights reserved
#include "mongoose.h"
const char *s_listening_url = "http://0.0.0.0:8000";
void device_dashboard_fn(struct mg_connection *, int, void *, void *);
int main(void) {
struct mg_mgr mgr;
mg_log_set("3");
mg_log_set("2"); // Set to 3 for debug, to 4 for very verbose level
mg_mgr_init(&mgr);
mg_http_listen(&mgr, "http://0.0.0.0:8000", device_dashboard_fn, &mgr);
for (;;) mg_mgr_poll(&mgr, 1000);
mg_http_listen(&mgr, s_listening_url, device_dashboard_fn, &mgr);
MG_INFO(("Listening on %s", s_listening_url));
while (mgr.conns != NULL) mg_mgr_poll(&mgr, 500);
mg_mgr_free(&mgr);
return 0;
}