1#include <userver/utest/using_namespace_userver.hpp>
3#include <userver/easy.hpp>
5std::string Greet(
const server::
http::HttpRequest& req) {
6 const auto& username = req.GetPathArg(
"user");
7 return "Hello, " + username;
11 std::string operator()(
const server::
http::HttpRequest& req)
const {
return "Hi, " + req.GetArg(
"name"); }
14int main(
int argc,
char* argv[]) {
15 easy::HttpWith<>(argc, argv)
16 .DefaultContentType(http::content_type::kTextPlain)
17 .Get(
"/hi/{user}", &Greet)