#include "request_router.h"
#include "request.h"
#include "response.h"
rs::httpserver::RequestRouter::RequestRouter() :
routes_({ {"GET",{}}, {"PUT",{}}, {"POST",{}}, {"DELETE",{}}, {"HEAD",{}} }) {
}
void rs::httpserver::RequestRouter::Add(const char* method, const char* re, Callback func) {
std::vector<:string> namedGroups;
const char* namedGroupStart = re;
while ((namedGroupStart = std::strstr(namedGroupStart, "(?<")) != nullptr) {
namedGroupStart += 3;
auto namedGroupPtr = namedGroupStart;
while (*namedGroupPtr != '>' && *namedGroupPtr) {
++namedGroupPtr;
}
namedGroups.emplace_back(namedGroupStart, namedGroupPtr);
namedGroupStart = namedGroupPtr + 1;
}
if (routes_.find(method) == routes_.cend()) {
routes_[method] = {};
}
routes_[method].push_back(std::make_tuple(boost::basic_regex