Merge pull request #168 from woodworker/feature-devrouter

added php internal webserver routing script
This commit is contained in:
Matthew Ross 2015-04-21 13:26:43 -04:00
commit 55eae2c2bf
3 changed files with 26 additions and 1 deletions

View File

@ -30,7 +30,7 @@ function exceptionHandler($exception) {
};
set_exception_handler('exceptionHandler');
R::setup('sqlite:taskboard.db');
R::setup('sqlite:'.__DIR__.'/taskboard.db');
createInitialUser();
$app->notFound(function() use ($app, $jsonResponse) {

17
devrouter.php Normal file
View File

@ -0,0 +1,17 @@
<?php
$root = __DIR__;
$file = $_SERVER['REQUEST_URI'];
if(file_exists($root.'/'.$file)){
return false;
}
$_SERVER['REQUEST_URI'] = str_replace('/api/', '/', $_SERVER['REQUEST_URI']);
$_SERVER['REQUEST_URI'] = str_replace('/api', '/', $_SERVER['REQUEST_URI']);
$_SERVER['SCRIPT_NAME'] = '/';
$_SERVER['PHP_SELF'] = $_SERVER['REQUEST_URI'];
$_SERVER['PATH_INFO'] = $_SERVER['PHP_SELF'];
require_once 'api/api.php';

View File

@ -33,6 +33,14 @@ The server must have `sqlite` and `php5-sqlite` installed, as well as the `rewri
**Optional:** to build minimized JavaScript and CSS (Install step 2) you must have a jre installed, tested with `openjdk-7-jre` and `openjdk-8-jre`.
### Development instance
You can start a simple development environment with the php internal webserver.
`php -S 127.0.0.1:8080 devrouter.php`
After launching the internal webserver go to http://127.0.0.1:8080/
###Install
Installing TaskBoard is as easy as 1, 2, 3!