2021-06-21 16:57:28 +00:00
|
|
|
//
|
|
|
|
// hello.cc
|
|
|
|
//
|
|
|
|
// Copyright (c) 2019 Yuji Hirose. All rights reserved.
|
|
|
|
// MIT License
|
|
|
|
//
|
|
|
|
|
|
|
|
#include <httplib.h>
|
|
|
|
using namespace httplib;
|
|
|
|
|
|
|
|
int main(void) {
|
|
|
|
Server svr;
|
|
|
|
|
|
|
|
svr.Get("/hi", [](const Request & /*req*/, Response &res) {
|
|
|
|
res.set_content("Hello World!", "text/plain");
|
|
|
|
});
|
|
|
|
|
2022-06-15 17:54:21 +00:00
|
|
|
svr.listen("0.0.0.0", 8080);
|
2021-06-21 16:57:28 +00:00
|
|
|
}
|