diff --git a/src/Tempest/Http/src/Commands/ServeCommand.php b/src/Tempest/Http/src/Commands/ServeCommand.php index 27168bce0..9ded5e961 100644 --- a/src/Tempest/Http/src/Commands/ServeCommand.php +++ b/src/Tempest/Http/src/Commands/ServeCommand.php @@ -14,6 +14,8 @@ )] public function __invoke(string $host = 'localhost', int $port = 8000, string $publicDir = 'public/'): void { - passthru("php -S {$host}:{$port} -t {$publicDir}"); + putenv("TEMPEST_PUBLIC_DIR={$publicDir}"); + $routerFile = __DIR__ . '/router.php'; + passthru("php -S {$host}:{$port} -t {$publicDir} {$routerFile}"); } } diff --git a/src/Tempest/Http/src/Commands/router.php b/src/Tempest/Http/src/Commands/router.php new file mode 100644 index 000000000..0205897f2 --- /dev/null +++ b/src/Tempest/Http/src/Commands/router.php @@ -0,0 +1,12 @@ +