-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
26 lines (21 loc) · 791 Bytes
/
Copy pathindex.php
File metadata and controls
26 lines (21 loc) · 791 Bytes
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
<?php
require_once "./lib/helpers/requestHelpers.php";
require_once "./lib/content_types.php";
require_once "./api/router.php";
require_once __DIR__ . '/vendor/autoload.php';
require_once "./db/mysql.php";
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->load();
header("X-Powered-By: ".$_ENV['X_POWERED_BY']);
// Set the appropriate headers for CORS
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");
header("Access-Control-Allow-Headers: Content-Type, Authorization");
$request_details = getRequestDetails();
if(isset($request_details['is_service'])){
setContentType('json');
router($request_details);
} else {
setResponseStatus(502);
print_r(file_get_contents('./assets/not-allowed.php'));
}