#include <userver/easy.hpp>
easy::HttpWith like class with erased dependencies information that should be used only in dependency registration functions; use easy::HttpWith if not making a new dependency class.
- Examples
- libraries/easy/samples/4_custom_dependency/main.cpp, and libraries/easy/samples/5_pg_service_template/src/main.cpp.
Definition at line 61 of file easy.hpp.
|
void | DefaultContentType (http::ContentType content_type) |
| Sets the default Content-Type header for all the routes.
|
|
void | Route (std::string_view path, Callback &&func, std::initializer_list< server::http::HttpMethod > methods) |
| Register an HTTP handler by path that supports the methods HTTP methods.
|
|
template<class Component > |
bool | TryAddComponent (std::string_view name, std::string_view config) |
| Append a component to the component list of a service.
|
|
template<class Component > |
bool | TryAddComponent (std::string_view name) |
|
void | DbSchema (std::string_view schema) |
| Stores the schema for further retrieval from GetDbSchema()
|
|
void | Port (std::uint16_t port) |
| Set the HTTP server listen port, default is 8080.
|
|
void | LogLevel (logging::Level level) |
| Set the logging level for the service.
|
|
◆ Callback
◆ DbSchema()
void easy::HttpBase::DbSchema |
( |
std::string_view | schema | ) |
|
◆ DefaultContentType()
Sets the default Content-Type header for all the routes.
Definition at line 157 of file easy.cpp.
◆ GetDbSchema()
const std::string & easy::HttpBase::GetDbSchema |
( |
| ) |
|
|
staticnoexcept |
◆ LogLevel()
Set the logging level for the service.
Definition at line 186 of file easy.cpp.
◆ Port()
void easy::HttpBase::Port |
( |
std::uint16_t | port | ) |
|
Set the HTTP server listen port, default is 8080.
Definition at line 184 of file easy.cpp.
◆ Route()
void easy::HttpBase::Route |
( |
std::string_view | path, |
|
|
Callback && | func, |
|
|
std::initializer_list< server::http::HttpMethod > | methods ) |
Register an HTTP handler by path
that supports the methods
HTTP methods.
Definition at line 159 of file easy.cpp.
◆ TryAddComponent() [1/2]
template<class Component >
bool easy::HttpBase::TryAddComponent |
( |
std::string_view | name | ) |
|
|
inline |
◆ TryAddComponent() [2/2]
template<class Component >
bool easy::HttpBase::TryAddComponent |
( |
std::string_view | name, |
|
|
std::string_view | config ) |
|
inline |
◆ HttpWith
The documentation for this class was generated from the following files: