From 4ef2647e573bdd94aa1b17182895ac3329e8764c Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Wed, 29 Oct 2025 22:49:31 +0200 Subject: [PATCH] fix container require path, add twig and error middleware, add first route to home --- bootstrap/app.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bootstrap/app.php b/bootstrap/app.php index 9b56f75..454837f 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -2,11 +2,18 @@ use Slim\Factory\AppFactory; use Slim\Views\Twig; +use Slim\Views\TwigMiddleware; +use FreightQuote\User\UserController; -$container = require './container.php'; +$container = require __DIR__.'/container.php'; $app = AppFactory::createFromContainer($container); $twig = Twig::create(__DIR__ . '/../templates', ['cache' => false]); +$app->add(TwigMiddleware::create($app, $twig)); +$app->addErrorMiddleware(true, false, false); + +$app->get('/', [UserController::class, 'home']); + return $app;