fix container require path, add twig and error middleware, add first route to home
This commit is contained in:
parent
6d11657ed4
commit
4ef2647e57
1 changed files with 8 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue