diff --git a/Sources/API/api/inscrit/add.php b/Sources/API/api/inscrit/add.php new file mode 100644 index 0000000..b637268 --- /dev/null +++ b/Sources/API/api/inscrit/add.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/Sources/API/api/inscrit/read.php b/Sources/API/api/inscrit/read.php index b086c1e..936cf78 100644 --- a/Sources/API/api/inscrit/read.php +++ b/Sources/API/api/inscrit/read.php @@ -3,7 +3,7 @@ header('Content-Type: application/json'); include_once (__DIR__.'/../../config/Database.php'); - include_once (__DIR__.'/../../models/Inscrit.php'); + include_once (__DIR__.'/../../gateways/Inscrit.php'); $database = new Database(); $db = $database->connect(); diff --git a/Sources/API/models/Inscrit.php b/Sources/API/gateways/Inscrit.php similarity index 100% rename from Sources/API/models/Inscrit.php rename to Sources/API/gateways/Inscrit.php diff --git a/Sources/API/index.php b/Sources/API/index.php index 72a2e1e..c35daea 100644 --- a/Sources/API/index.php +++ b/Sources/API/index.php @@ -7,7 +7,7 @@ $router->map( 'GET', '/', function(){ echo 'Hello World'; }); -$router->map('GET','/Inscrit', function(){ +$router->map('GET|POST','/Inscrit', function(){ require(__DIR__.'/api/inscrit/read.php'); }); @@ -15,6 +15,10 @@ $router->map('GET','/Inscrit/[*:mail]', function($mail){ require(__DIR__.'/api/inscrit/readFromMail.php'); }); +$router->match('POST|GET','/Inscrit/add', function(){ + require(__DIR__.'/api/Inscrit/add.php'); +}); + $match = $router->match(); if($match!=null) {