You've already forked cpp-httplib
Refactor the examples to compile with a C++11 compiler
This commit is contained in:
@ -105,7 +105,7 @@ int main(int argc, const char** argv)
|
||||
Server svr;
|
||||
#endif
|
||||
|
||||
svr.Post("/multipart", [](const auto& req, auto& res) {
|
||||
svr.Post("/multipart", [](const Request& req, Response& res) {
|
||||
auto body =
|
||||
dump_headers(req.headers) +
|
||||
dump_multipart_files(req.files);
|
||||
@ -113,14 +113,14 @@ int main(int argc, const char** argv)
|
||||
res.set_content(body, "text/plain");
|
||||
});
|
||||
|
||||
svr.set_error_handler([](const auto& /*req*/, auto& res) {
|
||||
svr.set_error_handler([](const Request& /*req*/, Response& res) {
|
||||
const char* fmt = "<p>Error Status: <span style='color:red;'>%d</span></p>";
|
||||
char buf[BUFSIZ];
|
||||
snprintf(buf, sizeof(buf), fmt, res.status);
|
||||
res.set_content(buf, "text/html");
|
||||
});
|
||||
|
||||
svr.set_logger([](const auto& req, const auto& res) {
|
||||
svr.set_logger([](const Request& req, const Response& res) {
|
||||
cout << log(req, res);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user