<IfModule mod_headers.c>
    # Allow access from your subdomain
    Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
    Header set Access-Control-Allow-Headers "Content-Type, Authorization, X-Requested-With, Content-Length, ngrok-skip-browser-warning"
    Header set Access-Control-Max-Age "86400"
</IfModule>

# Handle OPTIONS method (Preflight) directly in Apache
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]