addRoute('GET', '/hello[/{name}]', Hello::class); $r->addRoute('GET', '/other-route', [Other::class, 'someFunctionName']); $r->addRoute( 'GET', '/', fn (Response $r) => $r->withStatus(302)->withHeader('Location', '/hello') ); };