Added the hassankhan/config module
This commit is contained in:
15
src/routes.php
Normal file
15
src/routes.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Slim\Views\Twig;
|
||||
|
||||
// index GET route - this page should welcome the user and direct them to the available actions
|
||||
$app->get('/', function (Request $request, Response $response, $args) {
|
||||
$config = $this->get('config');
|
||||
|
||||
$view = Twig::fromRequest($request);
|
||||
return $view->render($response, 'index.twig', [
|
||||
'server_dir' => $config->get('server_directory'),
|
||||
]);
|
||||
})->setName('index');
|
Reference in New Issue
Block a user