2010-05-04 04:46:42 +08:00
|
|
|
#include "mongoose.h"
|
|
|
|
|
2010-05-05 07:36:23 +08:00
|
|
|
int main(void) {
|
2014-02-06 18:18:30 +08:00
|
|
|
struct mg_server *server = mg_create_server(NULL);
|
|
|
|
mg_set_option(server, "listening_port", "8080");
|
|
|
|
mg_set_option(server, "document_root", "chat_html_root");
|
2010-05-04 04:46:42 +08:00
|
|
|
|
2014-02-06 18:18:30 +08:00
|
|
|
printf("Starting on port %s\n", mg_get_option(server, "listening_port"));
|
|
|
|
for (;;) {
|
|
|
|
mg_poll_server(server, 1000);
|
2012-08-26 03:36:58 +08:00
|
|
|
}
|
2014-02-06 18:18:30 +08:00
|
|
|
mg_destroy_server(&server);
|
2010-05-04 04:46:42 +08:00
|
|
|
|
2014-02-06 18:18:30 +08:00
|
|
|
return 0;
|
2010-05-04 04:46:42 +08:00
|
|
|
}
|