Skip to content

Commit d4f35df

Browse files
committed
Add constants
1 parent f40f4aa commit d4f35df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

public/index.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@
1414
use Framework\MVC\App;
1515
use Framework\Routing\RouteCollection;
1616

17+
define('ENVIRONMENT', $_SERVER['ENVIRONMENT'] ?? 'production');
18+
define('IS_DEV', ENVIRONMENT === 'development');
19+
1720
$app = new App([
1821
'exceptionHandler' => [
1922
'default' => [
20-
'environment' => $_SERVER['ENVIRONMENT'] ?? ExceptionHandler::PRODUCTION,
23+
'environment' => ENVIRONMENT,
2124
'initialize' => true,
2225
'logger_instance' => 'default',
2326
],
@@ -28,7 +31,7 @@
2831
'level' => LogLevel::ERROR,
2932
],
3033
],
31-
]);
34+
], IS_DEV);
3235
App::router()->serve(null, static function (RouteCollection $routes) : void {
3336
$routes->get('/', static function () : array {
3437
return [

0 commit comments

Comments
 (0)