From ed8ab0d398865f5dc3bc1acbe39638b1572ead15 Mon Sep 17 00:00:00 2001 From: "dorian.hodin" Date: Mon, 30 Jan 2023 16:18:50 +0100 Subject: [PATCH] Add APIController.php , delete tmp.php, create some directories to organise the API and finalize the connection to the database --- Source/API/script/APIController.php | 29 +++++++++++++++++++ Source/API/script/{ => Config}/Connection.php | 0 Source/API/script/Config/config.php | 22 ++++++++++++++ Source/API/script/config.php | 20 ------------- Source/API/script/tmp.php | 3 -- 5 files changed, 51 insertions(+), 23 deletions(-) rename Source/API/script/{ => Config}/Connection.php (100%) create mode 100644 Source/API/script/Config/config.php delete mode 100644 Source/API/script/config.php delete mode 100644 Source/API/script/tmp.php diff --git a/Source/API/script/APIController.php b/Source/API/script/APIController.php index e69de29..f394218 100644 --- a/Source/API/script/APIController.php +++ b/Source/API/script/APIController.php @@ -0,0 +1,29 @@ +$action(); // Si oui, on appelle cette fonction + } + } + + } catch (PDOException) { + return http_response_code(404); + } + exit(0); + } + +} \ No newline at end of file diff --git a/Source/API/script/Connection.php b/Source/API/script/Config/Connection.php similarity index 100% rename from Source/API/script/Connection.php rename to Source/API/script/Config/Connection.php diff --git a/Source/API/script/Config/config.php b/Source/API/script/Config/config.php new file mode 100644 index 0000000..c5f00a2 --- /dev/null +++ b/Source/API/script/Config/config.php @@ -0,0 +1,22 @@ +getMessage(); - echo $PDOException->getCode(); - phpinfo(); - return http_response_code(404); -} diff --git a/Source/API/script/tmp.php b/Source/API/script/tmp.php deleted file mode 100644 index d4f7467..0000000 --- a/Source/API/script/tmp.php +++ /dev/null @@ -1,3 +0,0 @@ -HEY"; \ No newline at end of file