jeudi 31 mai 2018

How to allow external URL use in ember.js

I have a web app project using ember.js, and use this code to access an external site.

var request = new XMLHttpRequest();
request.open("GET", "my_url/extras", true);
request.send(null);
request.onreadystatechange = function() {
    if (request.readyState == 4)
       alert(request.responseText);  }

This causes the error in browser console: "Mirage: Your Ember app tried to GET 'my_url/extras', but there was no route defined to handle this request. Define a route that matches this path in your mirage/config.js file. Did you forget to add your namespace?"

My jquery version is 3.2.1, and tried the following passthroughs in mirage/config.js but still get the same error.

this.passthrough('my_url/extras');
this.passthrough('my_url/**')




Aucun commentaire:

Enregistrer un commentaire