This package is abandoned and no longer maintained. The author suggests using the huang-yi/shadowfax package instead.

The Swoole Http Server.

dev-master 2019-09-12 03:01 UTC

This package is auto-updated.

Last update: 2020-03-05 16:52:43 UTC


README

This package provides a HTTP server factory.

Usage

Require this package to your Laravel or Lumen project:

$ composer require shadowfax-php/http

Create a server.php file:

<?php

require __DIR__.'/vendor/autoload.php';

use Illuminate\Events\Dispatcher;
use ShadowfaxPHP\Http\HttpServerFactory;

$server = (new HttpServerFactory(new Dispatcher))
    ->setHost('127.0.0.1')
    ->setPort(1215)
    ->setOptions([
        'enable_static_handler' => true,
        'document_root' => public_path(),
    ])
    ->setAppBootstrapper(base_path('/bootstrap/app.php'))
    ->createServer();

$server->start();

Start the http server:

$ php server.php