mirror of
https://github.com/BreizhHardware/ProjetS4COMWEB.git
synced 2026-03-28 02:09:47 +01:00
Search with rest API
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
<?php
|
||||
|
||||
require_once 'src/router.php';
|
||||
require_once '../php/constants.php';
|
||||
require_once '../php/db/dbconnect.php';
|
||||
require_once '../php/db/Search.php';
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
$pdo = dbConnect();
|
||||
|
||||
|
||||
$router = new Router();
|
||||
|
||||
@@ -8,6 +15,22 @@ $router->GET('/api/requests', ["test"], function($test){
|
||||
echo json_encode($test);
|
||||
});
|
||||
|
||||
$router->GET('/api/search', ["type"], function($type){
|
||||
global $pdo;
|
||||
searchDoctor($pdo, $type);
|
||||
});
|
||||
|
||||
$router->GET('/api/search', ["type", "location"], function($type, $location){
|
||||
global $pdo;
|
||||
searchDoctorByLocation($pdo, $location, $type);
|
||||
});
|
||||
|
||||
$router->GET('/api/search', ["location"], function($location){
|
||||
global $pdo;
|
||||
searchDoctorByLocation($pdo, $location);
|
||||
});
|
||||
|
||||
|
||||
$router->POST('/api/requests', ["test"], function($test){
|
||||
echo json_encode($test);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user