Cleaned up code

This commit is contained in:
Chris 2017-10-25 08:35:17 +02:00
parent 8699df0060
commit 140681593c
2 changed files with 18 additions and 8 deletions

View File

@ -5,7 +5,7 @@ include('Config.php');
include('Route.php'); include('Route.php');
//config //config
Config::set('basepath',''); Config::set('basepath','/api/v1');
//init routing //init routing
Route::init(); Route::init();
@ -52,6 +52,16 @@ Route::add('/(.*)/(.*)/(.*)/(.*)',function($var1,$var2,$var3,$var4){
echo 'You have entered: '.$var1.' / '.$var2.' / '.$var3.' / '.$var4.'<br/>'; echo 'You have entered: '.$var1.' / '.$var2.' / '.$var3.' / '.$var4.'<br/>';
}); });
Route::add('/api/v1/deployment/(.*)',function($id){
//Do something
echo $id;
});
Route::add('/deployment/(.*)',function($id){
//Do something
echo $id;
});
//Add a 404 Not found Route //Add a 404 Not found Route
Route::add404(function($url){ Route::add404(function($url){