|
|
@ -30,7 +30,6 @@ $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) {
|
|
|
|
$response->withHeader('Content-type', 'application/json');
|
|
|
|
|
|
|
|
$parameters = $request->getQueryParams();
|
|
|
|
$parameters = $request->getQueryParams();
|
|
|
|
if (empty($parameters['method'])){
|
|
|
|
if (empty($parameters['method'])){
|
|
|
|
throw new TypeErrorMethod($request);
|
|
|
|
throw new TypeErrorMethod($request);
|
|
|
@ -53,8 +52,15 @@ $app->get('/', function (Request $request, Response $response) {
|
|
|
|
if (!$ok){
|
|
|
|
if (!$ok){
|
|
|
|
throw new HttpNotFoundError($request);
|
|
|
|
throw new HttpNotFoundError($request);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $response;
|
|
|
|
$temp = array(0 => array("id" => "1",
|
|
|
|
|
|
|
|
"0" => "1",
|
|
|
|
|
|
|
|
"title" => "Votre avis nous intéresse !",
|
|
|
|
|
|
|
|
"1" => "Votre avis nous intéresse !",
|
|
|
|
|
|
|
|
"description" => "Ce formulaire vous permet de candidater à une potentielle interview si votre profil nous intéresse.",
|
|
|
|
|
|
|
|
"2" => "Ce formulaire vous permet de candidater à une potentielle interview si votre profil nous intéresse."
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
$response->getBody()->write(json_encode($temp));
|
|
|
|
|
|
|
|
return $response->withHeader('Content-type', 'application/json');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|