diff --git a/Sources/API/config/Config.php b/Sources/API/config/Config.php index ea5064a..44f585a 100644 --- a/Sources/API/config/Config.php +++ b/Sources/API/config/Config.php @@ -2,7 +2,7 @@ //prefixe $rep=__DIR__.'/../'; -$dsn='mysql:host=10.9.0.67;dbname='.getenv("MARIADB_DATABASE"); +$dsn='mysql:host=10.9.0.65;dbname='.getenv("MARIADB_DATABASE"); $dbname=getenv("MARIADB_DATABASE"); $usr=getenv("MARIADB_USER"); $mdp=getenv("MARIADB_PASSWORD"); diff --git a/Sources/API/controler/.gitkeep b/Sources/API/controller/.gitkeep similarity index 100% rename from Sources/API/controler/.gitkeep rename to Sources/API/controller/.gitkeep diff --git a/Sources/API/controller/Controller.php b/Sources/API/controller/Controller.php new file mode 100644 index 0000000..58a4494 --- /dev/null +++ b/Sources/API/controller/Controller.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/Sources/API/index.php b/Sources/API/index.php index f663296..dbdd788 100644 --- a/Sources/API/index.php +++ b/Sources/API/index.php @@ -5,6 +5,14 @@ require_once(__DIR__.'/config/Config.php'); require_once(__DIR__.'/config/Autoload.php'); Autoload::charger(); -// loading a controler -$cont = new FrontControler(); +$router = new AltoRouter(); +$router->map('GET|POST',"/","test"); + +$match=$router->match(); + +if(!$match){echo "404"; die;} + +if($match){ + $cont = new Controller(); +} ?> \ No newline at end of file