RESTinio
Toggle main menu visibility
Loading...
Searching...
No Matches
sample/hello_world_minimal/main.cpp
#include <
restinio/core.hpp
>
int
main()
{
restinio::run
(
restinio::on_this_thread<>
()
.port(8080)
.address(
"localhost"
)
.request_handler([](
auto
req) {
return
req->create_response().set_body(
"Hello, World!"
).done();
}));
return
0;
}
core.hpp
Include all core header files in one.
restinio::on_this_thread
run_on_this_thread_settings_t< Traits > on_this_thread()
A special marker for the case when http_server must be run on the context of the current thread.
Definition
http_server_run.hpp:129
restinio::run
void run(asio_ns::io_context &ioctx, run_on_this_thread_settings_t< Traits > &&settings)
Helper function for running http server until ctrl+c is hit.
Definition
http_server_run.hpp:222
Generated by
1.17.0