pistache
pistache copied to clipboard
is it possible to have route that matches a regular wildcard (or an arbitrary number of splats)?
Hello, is it possible to have a route that matches a wildcard (or as an alternative an arbitrary number of splats)? In other words I would like to have a route:
mytest/*
that matches anything after *. For example: mytest/part1 mytest/part1/part2
Thanks
Hi the routes in Pistache is defined static, you can add these type of paths by interpreter or wrappers with your own implementation... This is not supported in this library by default
You could hook into the undefined route handler.
m_router.addNotFoundHandler(Rest::Routes::bind(handleNotFound));
@dennisjenkins75 or @oktal, do you know if it's possible to bind a callback for any OPTIONS endpoint? I tried...
Routes::Options(myrouter, "/*", ...);
But this returns Method Not Allowed to the client when they try OPTIONS /some/thing/blah
.