src/Server.php
public function appendOnPath($middleware, string $path, $priority = 0): Server
    {
        return $this->appendOnCondition(
            $middleware,
            $this->buildPathCondition($path),
            $priority
        );
    }
public function appendOnPath($middleware, string $path, $priority = 0): Server
    {
        return $this->appendOnCondition(
            $middleware,
            $this->buildPathCondition($path),
            $priority
        );
    }
public function appendOnPath ( $ middleware , string $ path , $ priority = 0 ) : Server { return $ this -> appendOnCondition ( $ middleware , $ this -> buildPathCondition ( $ path ) , $ priority ) ; }
Adds a middleware to the stack only if the request path matches.

The path must match exactly. If the "*" character is present, a comparison will be
made via regex. For example: the path '/api' matches only with request path '/api'.
But the path '/api/*' matches with all request paths that start with '/api/'.

The only position supported for the "*" character is at the end of the path. Other
positions may work today, but may no longer work in the future.

The path '*' (or '/*') matches with all request path. For performance reasons, in
this case you can consider using the `append()` method instead.

@param MiddlewareInterface|callable|array $middleware
@param string                             $path
@param int                                $priority
@return Server
Adds a middleware to the stack only if the request path matches .