PHP code example of reisraff / phulp-server

1. Go to this page and download the library: Download reisraff/phulp-server library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

reisraff / phulp-server example snippets




use Phulp\Server\Server;

$server = new Server([
    'address' => 'localhost',
    'port' => '8000',
    'router' => 'router.php',
    'path' => '/www/data',
]);

$server->fireRun();



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()
    );
});