Defining RESTAdapter properties on the fly


#1

Rather than using hardcoded values, I would prefer to define the host and authorization header of the RESTAdapter based on what is found in my hidden config.js file on startup.

DS.RESTAdapter.reopen({
    host: function() {
        return App.get('config.host');
    },
    headers: {
        "Authorization":  function() {
            return "Basic " + App.get('config.hash');
        }
    }
});

However, this does not work. Any other ideas?