title: How to use Mongoose(a http server) to serve different request?
body: <p>I am a newbie in http and I am using a embedded http server called mongoose.<br>
  Using a web root in ~/web_root, I would like to do :</p>
  
  <pre><code>if uri == "/hello"
      show "hello world"
  else
      show the file in web_root like index.html
  </code></pre>
  
  <p>I tried to use mongoose like this</p>
  
  <pre><code>  struct mg_server *server;
    server = mg_create_server(p, HttpEventHandler);
    mg_set_option(server, "document_root", "~/web_root");
    mg_set_option(server, "listening_port", "8080");
  
    for(;;)
      mg_poll_server(server, 1000);
  </code></pre>
  
  <p>and this is HttpEvenHandler</p>
  
  <pre><code>int HttpEventHandler(struct mg_connection *conn, mg_event ev) {
    if(ev == MG_AUTH)
      return MG_TRUE;
    else if(ev == MG_REQUEST) {
      if(strcmp("/hello", conn-&gt;uri) == 0) {
        mg_printf_data(conn, "%s\n", "hello world");
      }
      return MG_TRUE;
    }
  
  // I don't know what to write here
  
   return MG_FALSE;
  }
  </code></pre>