#include <iostream> #include "httplib.h" using namespace std; using namespace httplib; int main(){Server svr;svr.Get("/",[](const Request& req,Response& res){res.set_content("Hello World", "text/plain");});svr.Get("/gret/(.*)",[](const Request& req,Response& res){auto name=req.matches[1];res.set_content(name,"text/plain");}); svr.Get("/json", [](const Request& req, Response& res) {res.set_content(R"({"status": "ok"})", "application/json");});cout<<"Server running at http:127.0.0.1\n";svr.listen("0.0.0.0", 80);}