luwake/php-express

A pipeline framework use express.js api for php

dev-master 2017-10-14 07:34 UTC

README

A pipeline framework use express.js api for php

example

$app = new Express();

$app->get('/', function($req, $res, $next){
  return $res->body('Hello World');
});

$app->listen();

example 2

$app = new Express();

$app->route('/admin')->get('/', function($req, $res, $next){
  return $res->body('Hello Admin');
});

$app->get('/', function($req, $res, $next){
  return $res->body('Hello World');
});

$app->listen();

example 3

$app = new Express();

$app->set('views', __DIR__ . '/views');

$app->use('App\Middlewares\MethodOverride');

$app->use('/admin', require __DIR__ . '/routes/admin.php');

$app->use('/', require __DIR__ . '/routes/home.php');

$app->listen();

todo

some method need complete

log

use other library instead request and response