hello.cc 399 B

12345678910111213141516171819202122
  1. //
  2. // hello.cc
  3. //
  4. // Copyright (c) 2012 Yuji Hirose. All rights reserved.
  5. // The Boost Software License 1.0
  6. //
  7. #include <httplib.h>
  8. using namespace httplib;
  9. int main(void)
  10. {
  11. Server svr;
  12. svr.get("/hi", [](const Request& req, Response& res) {
  13. res.set_content("Hello World!", "text/plain");
  14. });
  15. svr.listen("localhost", 1234);
  16. }
  17. // vim: et ts=4 sw=4 cin cino={1s ff=unix