File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -13,22 +13,17 @@ public static function main(array $args = [])
1313 $ builder = WebHost::createDefaultBuilder ($ args );
1414 $ configuration = $ builder ->Configuration ;
1515
16- $ builder ->register (function ($ services ) {
17- // services
16+ $ builder ->register (function ($ services ) use ( $ configuration ) {
17+ // Services
1818 });
1919
2020 $ host = $ builder ->build ();
2121
22- $ host ->start (function ($ app ) use ($ configuration ) {
23- if ($ configuration ->getValue ('environment ' ) == 'development ' ) {
24- $ app ->UseExceptionHandler ();
25- } else {
26- $ app ->UseExceptionHandler ("/home/error " );
27- }
28-
22+ $ host ->start (function ($ app ) {
23+ // Middlewares
2924 $ app ->useRouter ();
30- // middlewares
3125 $ app ->useEndpoint (function ($ routes ) {
26+ // Routes
3227 $ routes ->mapGet ("/ " , fn () => "Hello World! " );
3328 });
3429 });
You can’t perform that action at this time.
0 commit comments