问题
How to configure router to handle xhr
and direct requests
to api.
Use Case : File Download
I have a RESTAPI
from which i am trying to download a file using an <a>
action link tag -> clicking on which resolves to a new Tab/Window with absolute url.
My webApp is serving at http://localhost:4200 proxying request
to http://localhost:44226
When i try to hit the api to download the file using the url http://localhost:4200/api/download/files/1
I Get the error :
UnrecognizedURLError: /api/download/files/1
Default Router
const Router = Ember.Router.extend({
location: config.locationType // auto
});
Router.map(function() {
this.route('login');
this.route('logout');
});
export default Router;
Any pointers how to proceed/what to change.
来源:https://stackoverflow.com/questions/39359470/emberjs-configure-router-to-handle-direct-get-requests