From 43eb75a9eaec28e4075f36652e55941e38d269fe Mon Sep 17 00:00:00 2001 From: Nico Devs Date: Fri, 1 May 2026 10:53:36 -0300 Subject: [PATCH] Add --router option to jigsaw serve --- src/Console/ServeCommand.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Console/ServeCommand.php b/src/Console/ServeCommand.php index e26920aa..b00e1710 100644 --- a/src/Console/ServeCommand.php +++ b/src/Console/ServeCommand.php @@ -47,6 +47,12 @@ protected function configure(): void null, InputOption::VALUE_NONE, 'Skip build before serving?', + ) + ->addOption( + 'router', + null, + InputOption::VALUE_OPTIONAL, + 'Path to a custom PHP router script.', ); } @@ -68,7 +74,13 @@ protected function fire() $this->console->info("Server started on http://{$host}:{$port}"); - passthru("php -S {$host}:{$port} -t " . escapeshellarg($this->getBuildPath($env))); + $command = "php -S {$host}:{$port} -t " . escapeshellarg($this->getBuildPath($env)); + + if ($router = $this->input->getOption('router')) { + $command .= ' ' . escapeshellarg($router); + } + + passthru($command); } private function getBuildPath($env)