diff --git a/src/Tempest/Http/src/Commands/ServeCommand.php b/src/Tempest/Http/src/Commands/ServeCommand.php index 9ded5e961..f00e3b629 100644 --- a/src/Tempest/Http/src/Commands/ServeCommand.php +++ b/src/Tempest/Http/src/Commands/ServeCommand.php @@ -14,7 +14,6 @@ )] public function __invoke(string $host = 'localhost', int $port = 8000, string $publicDir = 'public/'): void { - 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 index 35960037d..0f5e0f6ba 100644 --- a/src/Tempest/Http/src/Commands/router.php +++ b/src/Tempest/Http/src/Commands/router.php @@ -2,7 +2,7 @@ declare(strict_types=1); -$publicPath = getcwd() . '/' . rtrim($_ENV['TEMPEST_PUBLIC_DIR'], '/'); +$publicPath = $_SERVER['DOCUMENT_ROOT']; if (file_exists($publicPath . $_SERVER['REQUEST_URI'])) { return false;