File: /var/www/vhosts/creativefellows.nl/fvr.creativefellows.nl/config/routes.php
<?php
use App\Action\Preflight\PreflightAction;
use App\Action\Home\HomeAction;
use App\Action\View\ViewAction;
use App\Action\Form\FormPostAction;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Slim\App;
use Slim\Routing\RouteCollectorProxy;
return function (App $app) {
// preflight headers
$app->options('/{routes:.*}', PreflightAction::class);
// home
$app->get('/', HomeAction::class)->setName('home');
// page
$app->get('/{section}[/{page}]', ViewAction::class)->setName('page.view');
// form
$app->post('/submissions/submit/{id}/{name}', FormPostAction::class)->setName('form.post');
};