use thinkadoo\HttpServer\Builder;
use Symfony\Component\HttpFoundation\Request;
Builder::createBuiltInServer(function (Request $request) {
return "Hello " . $request->get('name');
})->listen(8080);
use thinkadoo\HttpServer\Builder;
use Symfony\Component\HttpFoundation\Request;
$app = new Silex\Application();
$app->get('/', function () {
return 'Hello';
});
$app->get('/hello/{name}', function ($name) {
return 'Hello ' . $name;
});
Builder::createBuiltInServer(function (Request $request) use ($app) {
return $app->handle($request);
})->listen(8080);
https://github.com/reactphp/react
use thinkadoo\HttpServer\Builder;
use Symfony\Component\HttpFoundation\Request;
Builder::createReactServer(function (Request $request) {
return "Hello " . $request->get('name');
})->listen(8080);
use thinkadoo\HttpServer\Builder;
use Symfony\Component\HttpFoundation\Request;
$app = new Silex\Application();
$app->get('/', function () {
return 'Hello';
});
$app->get('/hello/{name}', function ($name) {
return 'Hello ' . $name;
});
Builder::createReactServer(function (Request $request) use ($app) {
return $app->handle($request);
})->listen(8080);