File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 3333
3434using namespace std ::literals;
3535
36- constexpr boost::asio::string_view c_host { " 127.0.0.1" };
37- constexpr boost::asio::string_view c_port { " 8080" };
38- constexpr boost::asio::string_view c_target { " /graphql" };
39- constexpr int c_version = 11 ; // HTTP 1.1
40-
4136using namespace graphql ;
4237
4338namespace beast = boost::beast;
4439namespace http = beast::http;
4540namespace net = boost::asio;
4641using tcp = boost::asio::ip::tcp;
4742
43+ constexpr net::string_view c_host { " 127.0.0.1" };
44+ constexpr net::string_view c_port { " 8080" };
45+ constexpr net::string_view c_target { " /graphql" };
46+ constexpr int c_version = 11 ; // HTTP 1.1
47+
4848class Query
4949{
5050public:
@@ -95,9 +95,9 @@ std::future<std::string> Query::getRelay(std::string&& queryArg,
9595 net::io_context ioc;
9696 auto future = net::co_spawn (
9797 ioc,
98- [](std ::string_view host,
99- std ::string_view port,
100- std ::string_view target,
98+ [](net ::string_view host,
99+ net ::string_view port,
100+ net ::string_view target,
101101 int version,
102102 std::string requestBody) -> net::awaitable<std::string> {
103103 // These objects perform our I/O. They use an executor with a default completion token
Original file line number Diff line number Diff line change 3636
3737using namespace std ::literals;
3838
39- constexpr boost::asio::string_view c_host { " 127.0.0.1" };
40- constexpr unsigned short c_port = 8080 ;
41- constexpr boost::asio::string_view c_target { " /graphql" };
42-
4339using namespace graphql ;
4440
4541namespace beast = boost::beast;
@@ -50,6 +46,10 @@ using tcp = boost::asio::ip::tcp;
5046using tcp_stream = typename beast::tcp_stream::rebind_executor<
5147 net::use_awaitable_t <>::executor_with_default<net::any_io_executor>>::other;
5248
49+ constexpr net::string_view c_host { " 127.0.0.1" };
50+ constexpr unsigned short c_port = 8080 ;
51+ constexpr net::string_view c_target { " /graphql" };
52+
5353// Based on:
5454// https://www.boost.org/doc/libs/1_82_0/libs/beast/example/http/server/awaitable/http_server_awaitable.cpp
5555int main ()
You can’t perform that action at this time.
0 commit comments