slovocast/app/src/Routes.php

29 lines
623 B
PHP
Raw Normal View History

<?php
namespace Slovocast;
use Slim\App;
use Slovocast\Controller\HomePage;
use Slovocast\Controller\User\{
RegisterUserPage,
RegisterUserAction
};
use Slovocast\Middleware\VerifyPasswordMiddleware;
class Routes
{
public static function init(App $app): void
{
$app->get('/', HomePage::class);
// User Routes
self::users($app);
}
protected static function users(App $app): void
{
$app->get('/users/register', RegisterUserPage::class);
$app->post('/users/register', RegisterUserAction::class)
->add(VerifyPasswordMiddleware::class);
}
}