scil / LaravelFly

To be an absolutely safe solution to speed up Laravel with Swoole. Preloading + Coroutine and Tinker Online.
457 stars 41 forks source link

Update LaravelFlyServer.php FOR STATIC FILES REQUESTS #7

Closed xiaohuilam closed 6 years ago

xiaohuilam commented 7 years ago

经过测试laravelfly不支持静态请求, 于是我针对public下的静态资源进行了支持, 不算花括号代码再18行左右. 大大可以review下.

scil commented 6 years ago

Is it better to use nginx to support static files?

now Swoole 1.9.17 support static files two.

$serv = new Swoole\Http\Server("127.0.0.1", 9502);

$serv->set([
    'enable_static_handler' => true,
    'document_root' => '/data/webroot/www.swoole.com/'
]);