Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Router.inl
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#include "Stroika/Foundation/IO/Network/HTTP/Methods.h"
5
7
8 /*
9 ********************************************************************************
10 ******************************** WebServer::Route ******************************
11 ********************************************************************************
12 */
13 inline Route::Route (const RegularExpression& verbMatch, const RegularExpression& pathMatch, const RequestHandler& handler)
14 : fVerbAndPathMatch_{make_pair (verbMatch, pathMatch)}
15 , fHandler_{handler}
16 {
17 }
18 inline Route::Route (const RegularExpression& pathMatch, const RequestHandler& handler)
19 : Route{IO::Network::HTTP::MethodsRegEx::kGet, pathMatch, handler}
20 {
21 }
22 inline Route::Route (const function<bool (const String& method, const String& hostRelPath, const Request& request)>& requestMatcher,
23 const RequestHandler& handler)
24 : fRequestMatch_{requestMatcher}
25 , fHandler_{handler}
26 {
27 }
28
29}
RegularExpression is a compiled regular expression which can be used to match on a String class.
Route(const RegularExpression &verbMatch, const RegularExpression &pathMatch, const RequestHandler &handler)
Definition Router.inl:13