#include <userver/easy.hpp>
template<class Dependency = Dependencies<>>
class easy::HttpWith< Dependency >
Class for describing the service functionality in simple declarative way that generates static configs, applies schemas.
- See also
- Easy - library for single file prototyping
- Examples
- libraries/easy/samples/4_custom_dependency/main.cpp, and libraries/easy/samples/5_pg_service_template/src/main.cpp.
Definition at line 141 of file easy.hpp.
|
| HttpWith (int argc, const char *const argv[]) |
|
HttpWith & | DefaultContentType (http::ContentType content_type) |
| Sets the default Content-Type header for all the routes.
|
|
HttpWith & | Route (std::string_view path, Callback &&func, std::initializer_list< server::http::HttpMethod > methods={ server::http::HttpMethod::kGet, server::http::HttpMethod::kPost, server::http::HttpMethod::kDelete, server::http::HttpMethod::kPut, server::http::HttpMethod::kPatch, }) |
| Register an HTTP handler by path that supports the methods HTTP methods.
|
|
HttpWith & | Get (std::string_view path, Callback &&func) |
| Register an HTTP handler by path that supports the HTTP GET method.
|
|
HttpWith & | Post (std::string_view path, Callback &&func) |
| Register an HTTP handler by path that supports the HTTP POST method.
|
|
HttpWith & | Del (std::string_view path, Callback &&func) |
| Register an HTTP handler by path that supports the HTTP DELETE method.
|
|
HttpWith & | Put (std::string_view path, Callback &&func) |
| Register an HTTP handler by path that supports the HTTP PUT method.
|
|
HttpWith & | Patch (std::string_view path, Callback &&func) |
| Register an HTTP handler by path that supports the HTTP PATCH method.
|
|
HttpWith & | DbSchema (std::string_view schema) |
|
HttpWith & | Port (std::uint16_t port) |
| Set the HTTP server listen port, default is 8080.
|
|
HttpWith & | LogLevel (logging::Level level) |
| Set the logging level for the service.
|
|
◆ HttpWith()
template<class Dependency = Dependencies<>>
easy::HttpWith< Dependency >::HttpWith |
( |
int | argc, |
|
|
const char *const | argv[] ) |
|
inline |
◆ ~HttpWith()
template<class Dependency = Dependencies<>>
◆ DbSchema()
template<class Dependency = Dependencies<>>
◆ DefaultContentType()
template<class Dependency = Dependencies<>>
◆ Del()
template<class Dependency = Dependencies<>>
Register an HTTP handler by path
that supports the HTTP DELETE method.
Definition at line 207 of file easy.hpp.
◆ Get()
template<class Dependency = Dependencies<>>
Register an HTTP handler by path
that supports the HTTP GET method.
Definition at line 195 of file easy.hpp.
◆ LogLevel()
template<class Dependency = Dependencies<>>
Set the logging level for the service.
Definition at line 237 of file easy.hpp.
◆ Patch()
template<class Dependency = Dependencies<>>
Register an HTTP handler by path
that supports the HTTP PATCH method.
Definition at line 219 of file easy.hpp.
◆ Port()
template<class Dependency = Dependencies<>>
Set the HTTP server listen port, default is 8080.
Definition at line 231 of file easy.hpp.
◆ Post()
template<class Dependency = Dependencies<>>
◆ Put()
template<class Dependency = Dependencies<>>
Register an HTTP handler by path
that supports the HTTP PUT method.
Definition at line 213 of file easy.hpp.
◆ Route()
template<class Dependency = Dependencies<>>
HttpWith & easy::HttpWith< Dependency >::Route |
( |
std::string_view | path, |
|
|
Callback && | func, |
|
|
std::initializer_list< server::http::HttpMethod > | methods = { server::http::HttpMethod::kGet, server::http::HttpMethod::kPost, server::http::HttpMethod::kDelete, server::http::HttpMethod::kPut, server::http::HttpMethod::kPatch, } ) |
|
inline |
Register an HTTP handler by path
that supports the methods
HTTP methods.
Definition at line 178 of file easy.hpp.
The documentation for this class was generated from the following file: