userver: /data/code/userver/libraries/easy/samples/0_hello_world/main.cpp Source File
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
5int main(int argc, char* argv[]) {
6 easy::HttpWith<>(argc, argv)
7 .DefaultContentType(http::content_type::kTextPlain)
8 .Route("/hello", [](const server::http::HttpRequest& /*req*/) {
9 return "Hello world"; // Just return the string as a response body
10 });
11}