16 lines
511 B
PHP
16 lines
511 B
PHP
|
<?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');
|