std1.0.0-beta-7 SafeC docs

std :: http::route

Function std::http_route_match

#include <std/http/route.h> source · definition

long long http_route_match(const &char pattern, const &char path, &Vec<RouteParam> params)

Matches 'path' (no query string) against 'pattern', appending the captures to 'params' on success. Returns 0 for no match, or a positive specificity score — higher for more literal segments earlier on — that the router uses to prefer "/users/me" over "/users/:id" over "/users/*".