mcst/src/routes.php

16 lines
511 B
PHP
Raw Normal View History

2022-09-22 22:17:41 -04:00
<?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');