V0 : initial import
This commit is contained in:
20
ProserveAPI/htdocs/proserve/config/init.php
Normal file
20
ProserveAPI/htdocs/proserve/config/init.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
// CORS headers for web interface
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header("Access-Control-Allow-Methods: POST, GET, OPTIONS");
|
||||
header("Access-Control-Allow-Headers: Content-Type");
|
||||
header("Content-Type: application/json; charset=UTF-8");
|
||||
|
||||
// Handle preflight OPTIONS request
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
||||
http_response_code(200);
|
||||
exit();
|
||||
}
|
||||
|
||||
// include database and object files
|
||||
include_once '../config/database.php';
|
||||
|
||||
// get database connection
|
||||
$database = new Database();
|
||||
$db = $database->getConnection();
|
||||
?>
|
||||
Reference in New Issue
Block a user