engelsystem/config/routes.php

15 lines
387 B
PHP
Raw Normal View History

<?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)));
});