safeLoad(); require_once __DIR__ . "/session.php"; $app->add(TwigMiddleware::createFromContainer($app)); $app->add('csrf'); $app->get("/", [HomeController::class, 'get']); $app->group('/feed', function (RouteCollectorProxy $group) use ($app) { $group->get('[/]', [FeedController::class, 'get'])->add(LoginMiddleware::class); $group->post('[/]', [FeedController::class, 'save'])->add(LoginMiddleware::class); $group->get('/new', [FeedController::class, 'create'])->add(LoginMiddleware::class); $group->get('/{id}', [FeedController::class, 'get_feed']); $group->post('/{id}', [FeedController::class, 'save'])->add(LoginMiddleware::class); $group->get('/{id}/delete', [FeedController::class, 'delete'])->add(LoginMiddleware::class); $group->get('/{id}/edit', [FeedController::class, 'create'])->add(LoginMiddleware::class); }); $app->group('/account', function (RouteCollectorProxy $group) use ($app, $container) { $group->get('/login', [LoginController::class, 'index']); $group->post('/login', [LoginController::class, 'login']); }); $app->addErrorMiddleware(true, true, true); $app->run();