项目作者: jadephp

项目描述 :
Jade is a flexible PHP micro framework.
高级语言: PHP
项目地址: git://github.com/jadephp/jade.git
创建时间: 2019-08-01T11:02:52Z
项目社区:https://github.com/jadephp/jade

开源协议:

下载




CakePHP




Software License


Build Status


Coverage Status


Scrutinizer


Latest Stable Version

Jade is a flexible PHP micro framework to develop web applications and APIs

Installation

The recommended way to install Jade is through Composer:

  1. $ composer require jadephp/jade

Quick Start

  1. use Psr\Http\Message\ServerRequestInterface;
  2. use Psr\Http\Server\RequestHandlerInterface;
  3. use Zend\Diactoros\Response;
  4. // 1. Create App
  5. $app = new Jade\App();
  6. // 2. Add routes
  7. $app->get('/ping', function(ServerRequestInterface $request){
  8. return new Response\TextResponse('pong');
  9. });
  10. // 3. Add middlewares
  11. $app->pipe(function(ServerRequestInterface $request, RequestHandlerInterface $handler){
  12. $response = $handler->handle($request);
  13. return $response->withHeader('X-Jade-Version', '0.0.1');
  14. });
  15. // 4. Listen and serve.
  16. $app->serve();

The above code can create a simple heartbeat application.

Test this with the built-in PHP server:

  1. php -S 127.0.0.1:8000

Use the browser open http://127.0.0.1:8000/ping

Documentation

Read the documentation for more information

Tests

To run the test suite, you need PHPUnit:

  1. $ phpunit

License

Jade is licensed under The MIT license. See MIT