Adds proper safety for prod and added option for SSL

This commit is contained in:
Michel 2024-11-07 21:38:48 +01:00
parent 0962b609c4
commit d67c4063e4
6 changed files with 50 additions and 33 deletions

View file

@ -1,25 +0,0 @@
<?php
declare(strict_types=1);
use GamesShop\ContainerHandler;
use GamesShop\DoctrineManager;
use GamesShop\Environment\EnvironmentHandler;
use GamesShop\Routing\Router;
use Laminas\HttpHandlerRunner\Emitter\SapiEmitter;
use Whoops\Handler\HandlerInterface;
use Whoops\Handler\PrettyPageHandler;
use Whoops\Run;
require_once __DIR__ . '/../src/php/bootstrap.php';
$whoops = new Run();
$prettyPageHandler = new PrettyPageHandler();
$whoops->pushHandler($prettyPageHandler);
$whoops->register();
ContainerHandler::getInstance()->addShared(HandlerInterface::class, $prettyPageHandler);
$router = ContainerHandler::getInstance()->get(Router::class);
$result = $router->route();
(new SapiEmitter)->emit($result);