RESTinio v0.6.7 Release Notes
Release Date: 2020-05-11 // almost 4 years ago-
๐ New configuration options for CMake-based builds:
RESTINIO_USE_EXTERNAL_EXPECTED_LITE
,RESTINIO_USE_EXTERNAL_OPTIONAL_LITE
,RESTINIO_USE_EXTERNAL_STRING_VIEW_LITE
,RESTINIO_USE_EXTERNAL_VARIANT_LITE
.๐ New helper function
run_async
that allows to run an instance of RESTinio's server on a separate thread-pool or thread:int main() { auto server = restinio::run\_async( // Asio's io\_context to be used.// HTTP-server will use own Asio's io\_context object.restinio::own\_io\_context(), // The settings for the HTTP-server. restinio::server\_settings\_t{} .address("127.0.0.1") .port(8080) .request\_handler(...), // The size of thread-pool for the HTTP-server.16); // If we are here and run\_async doesn't throw then HTTP-server// is started. ... // Some other actions.// No need to stop HTTP-server manually. It will be automatically// stopped in the destructor of `server` object.}
๐ New helpers for working with HTTP-fields like
Authorization
andProxy-Authorization
, and helpers for the extraction of parameters for Basic authentication:#include \<restinio/all.hpp\>#include \<restinio/http\_field\_parser/basic\_auth.hpp\>...auto on\_request(const restinio::request\_handle\_t & req) { using namespace restinio::http\_field\_parsers::basic\_auth;const auto auth\_params = try\_extract\_params(\*req, restinio::http\_field::authorization); if(auth\_params) { // Parameters successfully extracted.if(is\_valid\_user(auth\_params-\>username, auth\_params-\>password)) { ... } } ... }
๐ Some bug fixes.