Example #1
0
 private void GoHandleRequest(HttpListenerRequest req, HttpListenerResponse resp)
 {
     try
     {
         var path = STATIC_DIR + req.Url.AbsolutePath;
         if (!File.Exists(path))
         {
             resp.CloseWithCode(404);
         }
         resp.WriteString(File.ReadAllText(path));
     }
     catch (Exception e)
     {
         //do nothing :(
     }
 }