addthis/fluxthis

Allow setting of a default base URL for APIActionCreators

jacobdfriedmann opened this issue · 0 comments

When using APIActionCreators, it would be nice to be able provide a base URL for all other routes to be appended to. It would work very similarly to how setting default headers works:

APIActionCreator.setDefaultBaseURL('http://myservice.com/');
var aac = new APIActionCreator({
    displayName: 'api',
    doThing: {
        // Request made to http://myservice.com/test
        route: '/test',
        method: 'GET'
    },
    doOtherThing: {
        // Override default with fully qualified URL
        // request made to http://myotherservice.com/test
        route: 'http://myotherservice.com/test',
        method: 'GET'
    }
});