ReactPHP router written in express.js style
PHP 7.1 and later.
SDK require the following extension in order to work properly:
If you’re using Composer, you can run the following command:
composer require kosatyi/react-express
Or add dependency manually in composer.json
{
"require": {
"kosatyi/react-express":"dev-master"
}
}
Import library to your project file.
<?php
require_once 'vendor/autoload.php';
use ReactExpress\Application;
$app = Application::instance();
$app->get('/',function( $app ){
$app->response->send('Hello World!');
});
$app->listen(8080,'127.0.0.1');
Stepan Kosatyi, stepan@kosatyi.com