Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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+.

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} !-d

RewriteRule . index\.php [L]

```

Then visit the application URL in the browser.