I tried million of different examples I found on the internet.
But I still can't do it :(
Here is my REST controller:
<?
namespace app\controllers\admiral_api;
use yii\rest\Controller;
class MainPageController extends Controller {
public function actionIndex() {
return 'test';
}
}
?>
I figured out I need to enable this 'Access-Control-Allow-Origin' via CORS filter on server side with Yii2. And it still doesn't work no matter what I tried.
Do you have any examples that work for you in this situation? Thank you!