Merge pull request #168 from woodworker/feature-devrouter
added php internal webserver routing script
This commit is contained in:
commit
55eae2c2bf
@ -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
17
devrouter.php
Normal 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';
|
@ -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!
|
||||
|
||||
|
Reference in New Issue
Block a user