element-api icon indicating copy to clipboard operation
element-api copied to clipboard

Element API endpoint url for multisites?

Open aaronrobb opened this issue 1 year ago • 0 comments

Description

I have a site with multiple "multisite" sites. When using the Element-api endpoint it only creates it for the base url. So if we have example.com and sub.example.com, element-api endpoint only gets created for example.com. The issue is that we have cross-domain policy that won't let the basic example.com urls load on the sub.example.com.

Is there a way to set the endpoint to create/use the currentSite url?

Steps to reproduce

  1. Create endpoints via the element-api.php file
  2. Load sub-domain site and get errors about cross domain loading.

Additional info

  • Craft version: 3.9.5
  • PHP version: 7.4.33
  • Database driver & version: MySQL 5.7.44
  • Plugins & versions:

aaronrobb avatar May 23 '24 15:05 aaronrobb