luwake / php-express
A pipeline framework use express.js api for php
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 1
Open Issues: 0
pkg:composer/luwake/php-express
Requires
- gpolguere/path-to-regexp-php: dev-master
- petrgrishin/pipe: dev-master
- react/http: ^1.3
Suggests
- symfony/var-dumper: Subtree split of the Symfony VarDumper Component
This package is not auto-updated.
Last update: 2025-10-01 21:13:03 UTC
README
A pipeline framework use express.js api and reactphp framework for php
example
$app = Express::Application(); $app->get('/', function(Request $req, Response $res){ return $res->send('Hello World'); }); $app->listen(8080);
example 2 sub router
$app = Express::Application(); $post = Express::Router(); $post->get('/:id', function(Request $req, Response $res){ return $res->send('Hello Post:' . $req->params['id']); }); $post->get('/', function(Request $req, Response $res){ return $res->send('Hello Post'); }); $app->use('/post', $post); $app->get('/', function(Request $req, Response $res){ return $res->send('Hello World'); }); $app->listen(8080);
example 3 middleware use
$app = Express::Application(); $app->use(Express::static(__DIR__)); $api = Express::Router('/api'); $api->use(Express::json()); $api->get('/', function(Request $req, Response $res){ return [ 'code' => 0, 'msg' => '', 'data' => [], ]; }); $app->use($api); $app->get('/', function(Request $req, Response $res){ return $res->send('Hello World'); }); $app->listen(8080);
todo
some method need complete