2018-02-01 12:49:40 +01:00
|
|
|
<?php
|
2019-10-10 04:13:04 +02:00
|
|
|
|
2023-06-08 12:38:43 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2021-08-28 01:45:25 +02:00
|
|
|
use App\Middleware;
|
2019-10-10 04:13:04 +02:00
|
|
|
use Slim\App;
|
2021-08-28 01:45:25 +02:00
|
|
|
use Slim\Routing\RouteCollectorProxy;
|
2018-08-05 00:05:14 +02:00
|
|
|
|
2021-08-28 01:45:25 +02:00
|
|
|
return static function (App $app) {
|
|
|
|
$app->group(
|
|
|
|
'',
|
|
|
|
function (RouteCollectorProxy $group) {
|
|
|
|
call_user_func(include(__DIR__ . '/routes/public.php'), $group);
|
|
|
|
}
|
2023-12-28 21:07:55 +01:00
|
|
|
)->add(Middleware\Auth\PublicAuth::class);
|
2018-02-01 12:49:40 +01:00
|
|
|
|
2021-08-28 01:45:25 +02:00
|
|
|
$app->group(
|
|
|
|
'',
|
|
|
|
function (RouteCollectorProxy $group) {
|
2023-12-28 21:07:55 +01:00
|
|
|
call_user_func(include(__DIR__ . '/routes/base.php'), $group);
|
|
|
|
}
|
|
|
|
)->add(Middleware\Auth\StandardAuth::class)
|
|
|
|
->add(Middleware\InjectSession::class);
|
|
|
|
|
|
|
|
$app->group(
|
|
|
|
'/api',
|
|
|
|
function (RouteCollectorProxy $group) {
|
|
|
|
$group->group(
|
|
|
|
'',
|
|
|
|
function (RouteCollectorProxy $group) {
|
|
|
|
call_user_func(include(__DIR__ . '/routes/api_public.php'), $group);
|
|
|
|
}
|
|
|
|
)->add(Middleware\Module\Api::class)
|
|
|
|
->add(Middleware\Auth\PublicAuth::class);
|
|
|
|
|
|
|
|
$group->group(
|
|
|
|
'',
|
|
|
|
function (RouteCollectorProxy $group) {
|
|
|
|
call_user_func(include(__DIR__ . '/routes/api_internal.php'), $group);
|
|
|
|
call_user_func(include(__DIR__ . '/routes/api_admin.php'), $group);
|
|
|
|
call_user_func(include(__DIR__ . '/routes/api_frontend.php'), $group);
|
|
|
|
call_user_func(include(__DIR__ . '/routes/api_station.php'), $group);
|
|
|
|
}
|
|
|
|
)
|
|
|
|
->add(Middleware\Module\Api::class)
|
|
|
|
->add(Middleware\Auth\ApiAuth::class)
|
|
|
|
->add(Middleware\InjectSession::class);
|
2021-08-28 01:45:25 +02:00
|
|
|
}
|
2023-12-28 21:07:55 +01:00
|
|
|
);
|
2018-06-13 14:52:30 +02:00
|
|
|
};
|