cpp-httplib/example/hello.cc

20 lines
328 B
C++
Raw Normal View History

2012-09-25 19:10:19 -07:00
//
// hello.cc
//
2019-06-27 18:48:57 -07:00
// Copyright (c) 2019 Yuji Hirose. All rights reserved.
// MIT License
2012-09-25 19:10:19 -07:00
//
2012-09-27 18:05:36 -07:00
#include <httplib.h>
using namespace httplib;
2012-09-25 19:10:19 -07:00
2019-04-11 05:13:31 -07:00
int main(void) {
Server svr;
2019-04-11 05:13:31 -07:00
svr.Get("/hi", [](const Request & /*req*/, Response &res) {
res.set_content("Hello World!", "text/plain");
});
2022-01-10 22:18:20 -07:00
svr.listen("0.0.0.0", 8080);
2012-09-25 19:10:19 -07:00
}