Added the hassankhan/config module

This commit is contained in:
2022-09-22 22:17:41 -04:00
parent 8c15b10389
commit 6af39995f7
6 changed files with 345 additions and 22 deletions

15
src/routes.php Normal file
View 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');