Skip to content

Commit ccc1ece

Browse files
authored
fix(http): use document root instead of env in tempest serve (#717)
1 parent f719c20 commit ccc1ece

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/Tempest/Http/src/Commands/ServeCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
)]
1515
public function __invoke(string $host = 'localhost', int $port = 8000, string $publicDir = 'public/'): void
1616
{
17-
putenv("TEMPEST_PUBLIC_DIR={$publicDir}");
1817
$routerFile = __DIR__ . '/router.php';
1918
passthru("php -S {$host}:{$port} -t {$publicDir} {$routerFile}");
2019
}

src/Tempest/Http/src/Commands/router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
$publicPath = getcwd() . '/' . rtrim($_ENV['TEMPEST_PUBLIC_DIR'], '/');
5+
$publicPath = $_SERVER['DOCUMENT_ROOT'];
66

77
if (file_exists($publicPath . $_SERVER['REQUEST_URI'])) {
88
return false;

0 commit comments

Comments
 (0)