16 lines
520 B
PHP
16 lines
520 B
PHP
<?php
|
|
$hostname = $_SERVER['HTTP_HOST'];
|
|
|
|
if ($hostname === 'api.stellaamor.com') {
|
|
// Production environment
|
|
header("Access-Control-Allow-Origin: https://stellaamor.com");
|
|
} else {
|
|
// Local environment
|
|
header("Access-Control-Allow-Origin: http://stellaamor.com.local");
|
|
}
|
|
header("Access-Control-Allow-Credentials: true");
|
|
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
|
|
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");
|
|
session_start();
|
|
?>
|