19 lines
538 B
C
Raw Normal View History

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