-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
executable file
·54 lines (39 loc) · 1.31 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
declare(strict_types=1);
spl_autoload_register(function ($class){
require __DIR__ . "/$class.php";
});
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE");
// $extra = explode("/trial", $_SERVER["REQUEST_URI"]) ?? null;
$extra = explode("/live", $_SERVER["REQUEST_URI"]) ?? null;
$endpoints = explode("?",$extra[1]) ?? null;
print_r($endpoints);
switch($endpoints[0]){
case "/auth/login":
echo 'login requested';
break;
case "/profile/save":
echo 'memberId'.$_POST['memberId'];
echo 'CompanyId'.$_POST['companyId'];
echo 'fileToUpload'.$_POST['fileToUpload'];
break;
default:
echo json_encode([
'count'=>0,
'list'=>['format error']
]);
}
// // print_r($extra2);
//
// $shredVal = empty($extra[1]) ? null : $_SERVER["REQUEST_URI"];
//
// $database = new Database("localhost", "ekso", "soke", "");
//
// $gateway = new ProductGateway($database);
//
// $controller = new Controller($gateway);
//
// $controller->ProcessRequest($_SERVER['REQUEST_METHOD'],$shredVal,$tblName);
?>