2024-05-16 01:42:24 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Slovocast;
|
|
|
|
|
|
|
|
use Slim\App;
|
2024-05-16 02:15:24 +00:00
|
|
|
use Slovocast\Controller\HomePage;
|
2024-05-16 01:42:24 +00:00
|
|
|
use Slovocast\Controller\User\{
|
|
|
|
RegisterUserPage,
|
|
|
|
RegisterUserAction
|
|
|
|
};
|
2024-06-16 01:50:40 +00:00
|
|
|
use Slovocast\Infrastructure\Middleware\VerifyPasswordMiddleware;
|
2024-05-16 01:42:24 +00:00
|
|
|
|
|
|
|
class Routes
|
|
|
|
{
|
|
|
|
public static function init(App $app): void
|
|
|
|
{
|
2024-05-16 02:15:24 +00:00
|
|
|
$app->get('/', HomePage::class);
|
2024-05-16 01:42:24 +00:00
|
|
|
// User Routes
|
|
|
|
self::users($app);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected static function users(App $app): void
|
|
|
|
{
|
|
|
|
$app->get('/users/register', RegisterUserPage::class);
|
2024-06-16 01:50:40 +00:00
|
|
|
$app->post('/users/register', RegisterUserAction::class)
|
|
|
|
->add(new VerifyPasswordMiddleware());
|
2024-05-16 01:42:24 +00:00
|
|
|
}
|
|
|
|
}
|