Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jadephp/jade
Jade is a flexible PHP micro framework.
https://github.com/jadephp/jade
framework jade jade-framework micro-framework php psr-15 psr-7 web-framework
Last synced: about 1 month ago
JSON representation
Jade is a flexible PHP micro framework.
- Host: GitHub
- URL: https://github.com/jadephp/jade
- Owner: jadephp
- Created: 2019-08-01T11:02:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-24T05:08:57.000Z (about 5 years ago)
- Last Synced: 2024-09-28T08:42:35.267Z (about 2 months ago)
- Topics: framework, jade, jade-framework, micro-framework, php, psr-15, psr-7, web-framework
- Language: PHP
- Homepage:
- Size: 99.6 KB
- Stars: 14
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Jade is a flexible PHP micro framework to develop web applications and APIs
## InstallationThe recommended way to install Jade is through Composer:
```bash
$ composer require jadephp/jade
```## Quick Start
```php
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Diactoros\Response;// 1. Create App
$app = new Jade\App();// 2. Add routes
$app->get('/ping', function(ServerRequestInterface $request){
return new Response\TextResponse('pong');
});// 3. Add middlewares
$app->pipe(function(ServerRequestInterface $request, RequestHandlerInterface $handler){
$response = $handler->handle($request);
return $response->withHeader('X-Jade-Version', '0.0.1');
});// 4. Listen and serve.
$app->serve();
```The above code can create a simple heartbeat application.
Test this with the built-in PHP server:
```bash
php -S 127.0.0.1:8000
```
Use the browser open `http://127.0.0.1:8000/ping`## Documentation
Read the [documentation](./docs/index.md) for more information
## Tests
To run the test suite, you need PHPUnit:
```bash
$ phpunit
```## License
Jade is licensed under The MIT license. See [MIT](https://opensource.org/licenses/MIT)