浏览代码

Added comment.

yhirose 13 年之前
父节点
当前提交
8b58a3aecc
共有 2 个文件被更改,包括 9 次插入9 次删除
  1. 3 3
      example/hello.cc
  2. 6 6
      example/sample.cc

+ 3 - 3
example/hello.cc

@@ -9,9 +9,9 @@
 
 
 int main(void)
 int main(void)
 {
 {
-    HTTP_SERVER("localhost", 1234) {
-        GET("/hi", {
-            res.set_content("Hello World!");
+    HTTP_SERVER("localhost", 1234) /* svr_ */ {
+        GET("/hi", /* req_, res_ */ {
+            res_.set_content("Hello World!");
         });
         });
     }
     }
 }
 }

+ 6 - 6
example/sample.cc

@@ -22,23 +22,23 @@ template<typename Fn> void signal(int sig, Fn fn)
 int main(void)
 int main(void)
 {
 {
     const char* hi = "/hi";
     const char* hi = "/hi";
-    HTTP_SERVER("localhost", 1234) {
-        // svr, req, res
+
+    HTTP_SERVER("localhost", 1234) /* svr_ */ {
 
 
         GET("/", {
         GET("/", {
-            res.set_redirect(hi);
+            res_.set_redirect(hi);
         });
         });
 
 
         GET("/hi", {
         GET("/hi", {
-            res.set_content("Hello World!");
+            res_.set_content("Hello World!");
         });
         });
 
 
         GET("/dump", {
         GET("/dump", {
-            res.set_content(dump_request(cxt));
+            res_.set_content(dump_request(cxt));
         });
         });
 
 
         signal(SIGINT, [&](){
         signal(SIGINT, [&](){
-            svr->stop();
+            svr_->stop();
         });
         });
     }
     }
 }
 }