From 786e3006da3a7d00a9085f4fb93e17c90928e4c3 Mon Sep 17 00:00:00 2001 From: "dorian.hodin" Date: Tue, 28 Feb 2023 09:47:15 +0100 Subject: [PATCH] Delete useless route --- Source/API/script/index.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Source/API/script/index.php b/Source/API/script/index.php index acb769c..a038c8b 100644 --- a/Source/API/script/index.php +++ b/Source/API/script/index.php @@ -27,16 +27,8 @@ try{ $app->get('/', function (Request $request, Response $response) { $parameters = $request->getQueryParams(); - foreach ($parameters as $key => $value) { - $response->getBody()->write("Key =>".$key.", value =>".$value); - } - return $response; - }); - - - $app->get('/api/{method}', function (Request $request, Response $response, $args) { - $method = $args['method']; - $parameters = $request->getQueryParams(); + $method = $parameters['method']; + $response->getBody()->write($method); $listGateway = array("\\Gateway\\GatewayForm", "\\Gateway\\GatewayKeyword", "\\Gateway\\GatewayQuestion"); foreach ($listGateway as $gateway) // Pour chaque Gateway { @@ -45,8 +37,12 @@ try{ } } $response->getBody()->write("Use the method $method, with the parameters "); + foreach ($parameters as $key => $value) { + $response->getBody()->write("Key =>" . $key . ", value =>" . $value); + } return $response; }); + // Run app $app->run(); }catch (HttpNotFoundException|Exception $e){