File: /var/www/vhosts/creativefellows.nl/comtel.creativefellows.nl/config/routes.php
<?php
use App\Action\Preflight\PreflightAction;
use App\Action\Cookie\CookieAction;
use App\Action\Home\HomeAction;
use App\Action\View\ViewAction;
use App\Action\Download\DownloadAction;
use App\Action\Download\DownloadRedirectAction;
use App\Action\Download\DownloadFormAction;
use App\Action\News\NewsListAction;
use App\Action\News\NewsListCategoryAction;
use App\Action\News\NewsViewAction;
use App\Action\Partner\PartnerLocatorAction;
use App\Action\Partner\PartnerCountryAction;
//use App\Action\Partner\PartnerRedirectAction;
use App\Action\Form\FormPostAction;
use App\Action\Search\SearchAction;
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);
// cookies
$app->post('/accept-cookies', CookieAction::class)->setName('cookies.accept');
// home
$app->get('/', HomeAction::class)->setName('home');
// xml sitemap
$app->get('/xml/sitemap', \App\Action\Sitemap\XmlSitemapAction::class)->setName('xml.view');
// download files
$app->get('/search', SearchAction::class)->setName('search.view');
// download files
$app->get('/documents', DownloadRedirectAction::class)->setName('document.view');
$app->get('/documents/[{page}]', DownloadAction::class)->setName('document.view');
// view pages
$app->get('/newsroom', NewsListAction::class)->setName('newsroom.list');
$app->get('/newsroom/{category}[/{page:[0-9]+}]', NewsListCategoryAction::class)->setName('newsroom.category');
$app->get('/newsroom/{category}/{page}', NewsViewAction::class)->setName('newsroom.view');
// partner locator
$app->get('/partners/find-a-partner', PartnerLocatorAction::class)->setName('partner.locator');
$app->post('/partners/country/{country}', PartnerCountryAction::class)->setName('partner.country');
//$app->get('/partners/{partner}', PartnerRedirectAction::class)->setName('partner.redirect');
// pages
//$app->get('/{page}', ViewAction::class)->setName('section.view');
$app->get('/{section}[/{page}]', ViewAction::class)->setName('page.view');
// forms
$app->post('/submissions/submit/{id}/{name}', FormPostAction::class)->setName('form.post');
$app->get('/submissions/download/{hash}/{filename}', DownloadFormAction::class)->setName("formfile.download");
//$app->get('/contact-us/form-succesfully-sent', ViewAction::class)->setName('form.submitted');
};