Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mariuslundgard/php-min
A minimal RESTful middleware framework for PHP 5.3+.
https://github.com/mariuslundgard/php-min
Last synced: 2 days ago
JSON representation
A minimal RESTful middleware framework for PHP 5.3+.
- Host: GitHub
- URL: https://github.com/mariuslundgard/php-min
- Owner: mariuslundgard
- Created: 2015-04-19T17:56:33.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-04-21T07:20:50.000Z (over 9 years ago)
- Last Synced: 2023-07-31T14:44:11.538Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 145 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# php-min
A minimal RESTful middleware framework for PHP 5.3+.
```
# Install using Composer
composer require mariuslundgard/php-min
```# Simple example
In an ```index.php``` file:
``` php
get('/', function ($req, $res) {
$res->body[] = 'Hello, world!
';
})
->process()->end();
```Add an ```.htaccess``` file in the same directory:
```
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-dRewriteRule . index\.php [L]
```
Then visit the application URL in the browser.