userver
C++ Async Framework
Loading...
Searching...
No Matches
main.cpp
1
#
include
<
userver
/
utest
/
using_namespace_userver
.
hpp
>
// Note: this is for the purposes of samples only
2
3
#
include
<
userver
/
easy
.
hpp
>
4
5
std::string Greet(
const
server::
http
::HttpRequest& req) {
6
const
auto
& username = req
.
GetPathArg
(
"user"
)
;
7
return
"Hello, "
+ username;
8
}
9
10
struct
Hi {
11
std::string operator()(
const
server::
http
::HttpRequest& req)
const
{
return
"Hi, "
+ req
.
GetArg
(
"name"
)
; }
12
};
13
14
int
main(
int
argc,
char
* argv[]) {
15
easy
::HttpWith<>(argc, argv)
16
.
DefaultContentType
(
http::
content_type
::kTextPlain
)
17
.
Get
(
"/hi/{user}"
,
&Greet
)
18
.
Get
(
"/hi"
,
Hi{}
)
;
19
}
samples
1_hi
main.cpp
Generated on Thu May 21 2026 16:16:05 for userver by
Doxygen
1.13.2