23 lines
502 B
PHP
23 lines
502 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
$host = 'localhost';
|
|
$port = $argv[1] ?? '8000';
|
|
$port = preg_match('/^\d{2,5}$/', $port) === 1 ? $port : '8000';
|
|
$root = __DIR__;
|
|
$router = __DIR__ . DIRECTORY_SEPARATOR . 'router.php';
|
|
|
|
echo "GeoDraw is running at http://{$host}:{$port}/\n";
|
|
echo "Press Ctrl+C to stop the server.\n\n";
|
|
|
|
passthru(
|
|
escapeshellarg(PHP_BINARY)
|
|
. ' -S '
|
|
. escapeshellarg("{$host}:{$port}")
|
|
. ' -t '
|
|
. escapeshellarg($root)
|
|
. ' '
|
|
. escapeshellarg($router),
|
|
);
|