userver: samples/hello_service/hello_service.cpp
Loading...
Searching...
No Matches
samples/hello_service/hello_service.cpp
namespace samples::hello {
class Hello final : public server::handlers::HttpHandlerBase {
public:
// `kName` is used as the component name in static config
static constexpr std::string_view kName = "handler-hello-sample";
// Component is valid after construction and is able to accept requests
using HttpHandlerBase::HttpHandlerBase;
std::string HandleRequestThrow(
return "Hello world!\n";
}
};
} // namespace samples::hello
int main(int argc, char* argv[]) {
const auto component_list =
components::MinimalServerComponentList().Append<samples::hello::Hello>();
return utils::DaemonMain(argc, argv, component_list);
}