26 lines
556 B
PHP
26 lines
556 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Core\Commands;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* NovaCore Serve Command
|
||
|
|
* CLI command to start development server
|
||
|
|
*/
|
||
|
|
class ServeCommand
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Execute the command
|
||
|
|
*/
|
||
|
|
public function execute(): void
|
||
|
|
{
|
||
|
|
$port = getenv('APP_PORT') ?: '8000';
|
||
|
|
$host = getenv('APP_HOST') ?: 'localhost';
|
||
|
|
|
||
|
|
echo "NovaCore Framework development server starting...\n";
|
||
|
|
echo "Server running at http://{$host}:{$port}\n";
|
||
|
|
echo "Press Ctrl+C to stop the server\n\n";
|
||
|
|
|
||
|
|
exec("php -S {$host}:{$port} -t public");
|
||
|
|
}
|
||
|
|
}
|