eeprom/public/index.php

28 lines
592 B
PHP
Raw Normal View History

2020-05-08 22:53:21 +00:00
<?php
namespace EEPROM;
use RuntimeException;
use Index\Http\HttpFx;
2020-05-08 22:53:21 +00:00
require_once __DIR__ . '/../eeprom.php';
2020-05-08 22:53:21 +00:00
2023-10-31 16:19:58 +00:00
set_exception_handler(function(\Throwable $ex) {
\Sentry\captureException($ex);
ob_clean();
http_response_code(500);
if(PRM_DEBUG) {
header('Content-Type: text/plain; charset=utf-8');
echo (string)$ex;
} else echo '500';
exit;
});
2023-11-09 20:29:57 +00:00
ob_start();
2023-10-31 16:10:32 +00:00
2023-11-09 20:29:57 +00:00
$request = \Index\Http\HttpRequest::fromRequest();
$isApiDomain = $request->getHeaderLine('Host') === $cfg->getString('domain:api');
2020-05-08 22:53:21 +00:00
2023-11-09 20:29:57 +00:00
$eeprom->createRouting($isApiDomain)->dispatch($request);