Serving ember on a CDN separate from the host page


#1

I’m trying to deploy my compiled ember JS app on a CDN - I’m using divshot, and I’m serving my host page from a separate webapp hosted in heroku.

Currently I’m getting the following error - SecurityError: Failed to execute ‘replaceState’ on ‘History’

The reason I want to do this is because my emberJS app is going to get very big, while to application side web front end logic will be serving up very little data. Basically it just need to create a host page to inject the API endpoint my ember app will be talking to. A 2nd reason is it’ll allow me to deploy multiple versions of the ember app and do A/B testing of new feature releases.

My webapp is serving an route such as, 'http://hostapp/:customerName’ with HTML content,

<!DOCTYPE html>
<html>
  <head>
    <script>window.apiUrl = "http://hostapp/api/customer/nameofcustomer"</script>
  </head>
  <body>    
    <script src="http://cdnaddress/vendor.js"></script>
    <script src="http://cdnaddress/myemberapp.js"></script>    
  </body>
</html>

please advise