Skip to content

Commit

Permalink
🔧 Restore default routing removed in #387
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Aug 24, 2024
1 parent dce6d72 commit feea5d9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Roots/Acorn/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,19 @@ public static function configure(?string $basePath = null)
default => ApplicationBuilder::inferBasePath(),
};

$web = $basePath.'/routes/web.php';
$api = $basePath.'/routes/api.php';

return (new ApplicationBuilder(new static($basePath)))
->withPaths()
->withKernels()
->withEvents()
->withCommands()
->withProviders()
->withRouting(
web: file_exists($web) ? $web : null,
api: file_exists($api) ? $api : null,
)
->withMiddleware()
->withExceptions();
}
Expand Down

0 comments on commit feea5d9

Please sign in to comment.