Skip to content

Commit

Permalink
replace swoole_http_server
Browse files Browse the repository at this point in the history
  • Loading branch information
koriym committed Nov 9, 2018
1 parent 9ecac4d commit 93e437e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
use BEAR\Swoole\WebContext;
use Swoole\Http\Request;
use Swoole\Http\Response;
use Swoole\Http\Server;

return function (string $context, string $name, string $ip, string $port) : int {
if (! class_exists('swoole_http_server')) {
throw new \RuntimeException('Swoole is not installed. See https://github.com/swoole/swoole-src/wiki/Installing');
}
$http = new swoole_http_server($ip, $port);
$http = new Server($ip, $port);
$http->on('start', function () use ($ip, $port) {
echo "Swoole http server is started at http://{$ip}:{$port}" . PHP_EOL;
});
Expand Down

0 comments on commit 93e437e

Please sign in to comment.