mongoose/examples/device-dashboard/main.c

19 lines
558 B
C
Raw Normal View History

2022-05-13 23:47:10 +08:00
// Copyright (c) 2020-2022 Cesanta Software Limited
2020-12-05 19:26:32 +08:00
// All rights reserved
#include "mongoose.h"
2022-06-05 21:59:59 +08:00
const char *s_listening_url = "http://0.0.0.0:8000";
2020-12-05 19:26:32 +08:00
2022-05-15 21:40:58 +08:00
void device_dashboard_fn(struct mg_connection *, int, void *, void *);
2020-12-05 19:26:32 +08:00
int main(void) {
struct mg_mgr mgr;
2022-06-05 21:59:59 +08:00
mg_log_set("2"); // Set to 3 for debug, to 4 for very verbose level
2020-12-05 19:26:32 +08:00
mg_mgr_init(&mgr);
2022-06-05 21:59:59 +08:00
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);
2022-05-15 21:40:58 +08:00
mg_mgr_free(&mgr);
2020-12-05 19:26:32 +08:00
return 0;
}