This is simple php code/class which proxies REST api calls from local domain to remote api server.
Git clone then
cd php-proxy
cp dist.config.php config.php
and update configuration settings in config.php
server params.
In your JS client set all urls to be:
https://your-server-path/proxy.php?path=/api_path
Let's say you have api endpoint
https://api.example.com/entities
in your config.php
set
return [
'destination_url' => 'https://api.example.com'
];
let's say your domain is www.example.com
, and then link to your endpoint is
https://www.example.com?path=/entities