Files
expose/app/Commands/ServeCommand.php
Marcel Pociot 2778d5a489 wip
2020-04-16 15:30:53 +02:00

26 lines
614 B
PHP

<?php
namespace App\Commands;
use App\Server\Factory;
use Illuminate\Console\Scheduling\Schedule;
use LaravelZero\Framework\Commands\Command;
use React\EventLoop\LoopInterface;
class ServeCommand extends Command
{
protected $signature = 'serve {host=0.0.0.0} {hostname=localhost}';
protected $description = 'Start the shaft server';
public function handle()
{
(new Factory())
->setLoop(app(LoopInterface::class))
->setHost($this->argument('host'))
->setHostname($this->argument('hostname'))
->createServer()
->run();
}
}