- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
#include <iostream>
#include <restinho/all.hpp>
int main()
{
restinho::http_server_t<> http_server{
restinho::create_child_io_context(1),
[](auto & settings) {
settings.port(8080).address("localhost")
.request_handler([](auto req) {
req->create_response().set_body("answer").done();
return restinho::request_accepted();
});
}};
http_server.open();
std::cin.ignore();
http_server.close();
return 0;
}