We would like to announce next release of RESTinio a header-only C++14 library that gives you an embedded HTTP server with nice express-like routing (although it is not mandatory to use router) and websockets on board. See of previous release on reddit.

What's new:

  • Timer manager concept introduced. Timers performance improved.
  • Express router: introduce a concept of regex engine, so express router can run on pcre/pcre2 engines or the one provided by user. For example you can use PCRE library for regex:
        using router_t = restinio::router::express_router_t< restinio::router::pcre_regex_engine_t >;
          auto router = std::make_unique< router_t >();
            []( auto req, auto params ){
              // Handle request.
            } );
          // Add more routes ...
  • Express router: introducing functions for converting route parameters to a specific type (if conversion is available).
              []( auto req, auto params ){
               const auto id = restinio::cast_as< unsigned int >(params["user_id"]);
               const auto tag = restinio::cast_as< std::string >(params["tag"]);
               const auto posts = get_users_posts( id, tag );
               if( posts.empty() )
                return req->create_response( 404, "Not found")
                  .append_header( "Server", "RESTinio routers example" )
                // Has posts
                return write_posts_response( std::move( req ), posts );
            } );
  • Express router: getting rid of using strings for storing parameters keys and values in route_params_t and using string_view (std::string_view if available).
  • Express router: update route to regex processing in order to stick with path-to-regexp project.
  • Express router: a handler for non matched request can be set.
            []( auto req ){
                req->create_response( 404, "Not found")
            } );
  • Express router: add a benchmark for testing performance on a given set of routes (described in file), this makes it possible to do quick benchmark of RESTinio+router performance on a given set of routes.
  • Improve query string params. Parsed parameters stored as string_view objects, thus requiring less space and less allocations.
  • Add benchmarks: add benchmarks for a single handler servers.
  • Add cmake support for SObjectizer dependent test and samples.
  • Documentation moved here.