15 lines
387 B
PHP
15 lines
387 B
PHP
|
<?php
|
||
|
|
||
|
use FastRoute\RouteCollector;
|
||
|
use Psr\Http\Message\ServerRequestInterface;
|
||
|
|
||
|
/** @var RouteCollector $route */
|
||
|
|
||
|
/** Demo route endpoint, TODO: Remove */
|
||
|
$route->addRoute('GET', '/hello/{name}', function ($request) {
|
||
|
/** @var ServerRequestInterface $request */
|
||
|
$name = $request->getAttribute('name');
|
||
|
|
||
|
return response(sprintf('Hello %s!', htmlspecialchars($name)));
|
||
|
});
|