hello.cc 481 B

123456789101112131415161718192021222324252627
  1. //
  2. // hello.cc
  3. //
  4. // Copyright (c) 2012 Yuji Hirose. All rights reserved.
  5. // The Boost Software License 1.0
  6. //
  7. #include <httpsvrkit.h>
  8. int main(void)
  9. {
  10. HTTP_SERVER("localhost", 1234) {
  11. // const httpsvrkit::Request& req
  12. // httpsvrkit::Response& res
  13. GET("/hello", {
  14. res.set_content("world");
  15. });
  16. GET("/url", {
  17. res.set_content(req.url);
  18. });
  19. }
  20. }
  21. // vim: et ts=4 sw=4 cin cino={1s ff=unix