blob: 1d082fb48f578bf53797f54009b56e0dea9078b4 (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
module;
#include <boost/asio/awaitable.hpp>
export module routemon:srv;
import :api;
import :http.server;
namespace routemon::srv {
class handler
{
api::handler inner_;
public:
using outer_ctx = http::trace_id_ctx<http::base_ctx>;
using l0_ctx = http::routed_ctx<outer_ctx>;
private:
auto handle_process_gpx(l0_ctx ctx, http::readable_request r)
-> net::awaitable<http::presponse>;
auto handle_sysinfo(l0_ctx ctx, http::readable_request r)
-> net::awaitable<http::presponse>;
public:
handler(api::handler&& inner);
auto make_routes() -> http::route_tree<http::routed_ctx<outer_ctx>>;
};
export class server
{
handler handler_;
http::server srv_;
static auto make_global_middleware()
-> http::middleware_t<http::base_ctx, handler::outer_ctx>;
public:
server(log::logger const& l, locale::selector&& lsel, api::handler&& inner);
auto spawn(net::io_context& ioc) -> void;
};
} // namespace routemon::srv
|