71 |
|
|
72 |
m_context = mg_start(); |
m_context = mg_start(); |
73 |
mg_set_option(m_context, "ports", oss.str().c_str() ); |
mg_set_option(m_context, "ports", oss.str().c_str() ); |
74 |
|
mg_set_option(m_context, "root", "/nosuchpatch"); //set root to non-existant path to disable normal file serving - only callbacks are now serviced |
75 |
|
|
76 |
mg_set_uri_callback(m_context, "/", &show_index, 0); |
mg_set_uri_callback(m_context, "/", &show_index, 0); |
77 |
mg_set_uri_callback(m_context, "/status", &show_status, 0); |
mg_set_uri_callback(m_context, "/status", &show_status, 0); |
78 |
mg_set_error_callback(m_context, 404, show_404, NULL); |
mg_set_error_callback(m_context, 404, show_404, NULL); |