Go back to original API
continuous-integration/drone/push Build is passing Details

master
dorian.hodin 2 years ago
parent 851fb8d72a
commit f6810abb1c

@ -29,14 +29,14 @@ $errorMiddleware = $app->addErrorMiddleware(true, true, true);
/** /**
* Add a route for the API * Add a route for the API
*/ */
$app->get('/', function (Request $request, Response $response) {
$app->get('/', function (Request $request, Response $response){
throw new TypeErrorMethod($request);
});
$app->get('/api/{method}', function (Request $request, Response $response, array $args) {
$parameters = $request->getQueryParams(); $parameters = $request->getQueryParams();
$method = $args['method']; if (empty($parameters['method'])){
throw new TypeErrorMethod($request);
}else{
$method = $parameters['method'];
}
unset($parameters['method']);
$listGateway = array("\\Gateway\\GatewayForm", "\\Gateway\\GatewayKeyword", "\\Gateway\\GatewayQuestion"); $listGateway = array("\\Gateway\\GatewayForm", "\\Gateway\\GatewayKeyword", "\\Gateway\\GatewayQuestion");
$ok = false; $ok = false;
foreach ($listGateway as $gateway){ foreach ($listGateway as $gateway){

Loading…
Cancel
Save