It's just really easy
Use Composer
{
"require": {
"codification-nl/hashbang": "dev-master"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/codification-nl/Hashbang"
}
]
}
<?php
require __DIR__ . '/vendor/autoload.php';
$app = new \Hashbang\App();
$app->get('hello(/:test)?', function ($data, $test = 'world')
{
return \Hashbang\Response::ok([
'result' => $test,
]);
});
$app->run();
RewriteEngine On
RewriteBase /
RewriteRule ^api/(.*)$ api.php?route=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ #!/$1 [R=303,NE]