Phulp Server
It's a third-party project that's wrapper for "php built-in server"
Usage
Install:
$ composer require --dev reisraff/phulp-server
Coding:
<?php use Phulp\Server\Server; $server = new Server([ 'address' => 'localhost', 'port' => '8000', 'router' => 'router.php', 'path' => '/www/data', ]); $server->fireRun();
Using with PHULP.
<?php use Phulp\Server\Server; $phulp->task('serve', function ($phulp) use ($config) { $server = new Server( [ 'address' => 'localhost', 'port' => '8000', 'router' => 'router.php', 'path' => $config['project_path'], ], $phulp->getLoop() ); });