only static method
Wraps a middleware to ONLY execute if the request path matches path.
Implementation
static Middleware only(String path, Middleware middleware) {
return (ctx, next) async {
if (ctx.request.uri.path == path) {
return middleware(ctx, next);
}
return next();
};
}