feat(workflow): example stats page with embedded Chart.js, inline form validation errors
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -104,7 +104,7 @@ void Router::include_router(const std::string& prefix, const Router& other,
|
||||
}
|
||||
}
|
||||
|
||||
bool Router::match(Request& req, Handler& out) const {
|
||||
bool Router::match(Request& req, Handler& out, std::string* pattern) const {
|
||||
for (const auto& r : routes_) {
|
||||
bool method_ok = false;
|
||||
for (Method m : r.methods) {
|
||||
@@ -118,6 +118,7 @@ bool Router::match(Request& req, Handler& out) const {
|
||||
if (match_pattern(r.pattern, req.path, params)) {
|
||||
for (auto& [k, v] : params) req.path_params[k] = v;
|
||||
out = r.handler;
|
||||
if (pattern) *pattern = r.pattern;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user