Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 359 Bytes

ReactPHP.md

File metadata and controls

25 lines (16 loc) · 359 Bytes

ReactPHP

<?php

declare(strict_types=1);

namespace App;

use Chubbyphp\Framework\Application;
use React\EventLoop\Factory;
use React\Http\Server;
use React\Socket\Server as Socket;

$app = new Application([]);

$loop = Factory::create();

$socket = new Socket(8080, $loop);

$server = new Server($app);
$server->listen($socket);

$loop->run();