diff --git a/config/routes/app.php b/config/routes/app.php index a6a4427..e8bae41 100644 --- a/config/routes/app.php +++ b/config/routes/app.php @@ -3,18 +3,18 @@ use \Psr\Http\Message\ServerRequestInterface as Request; use \Psr\Http\Message\ResponseInterface as Response; -$app->get('/hello/{name}', function(Request $request, Response $response, $args) { - $name = $request->getAttribute('name'); - $response->getBody()->write("Hello, $name"); - - return $response; -}); - // example route to resolve request to uri '/' to \\App\\Http\\Site\\Welcome::index $app->any('/', function(Request $request, Response $response, $args) use($app) { return $app->resolveRoute('\App\Http\Site', 'Welcome', 'index', $args); }); +$app->get('/hello/{name}', function(Request $request, Response $response, $args) { + $name = $request->getAttribute('name'); + $response->getBody()->write("Hello, $name"); + + return $response; +}); + // example route to resolve request to that matches '/{class}/{method}' // resolveRoute will try to find a corresponding class::method in a given namespace $app->any('/{class}/{method}', function(Request $request, Response $response, $args) use($app) { diff --git a/lib/Framework/App.php b/lib/Framework/App.php index 9a5029b..d56fea4 100644 --- a/lib/Framework/App.php +++ b/lib/Framework/App.php @@ -1,7 +1,7 @@