Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Services call stacks

Services call stacks


I have writen a huge amount of backbone.js models, collections and most of them content RESTful service calls using URL.

How can i make these URL service calls as Central Hub, where all the urls are added and all the models / collections refer this central hub for their RESTful calls.

Problem courtesy of: Ashwin Hegde


I used a specific model for settings on a recent project and stored the data in an external json file.


    "service-1": "",
    "service-2": ""


var SettingsModel = Backbone.Model.extend({
    url: 'scripts/data/settings.json'


var settings = new SettingsModel();
    success: function() { 
        var model = new MyModel({ url: this.get('service-1') });
Solution courtesy of:


View additional discussion.

This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

Services call stacks


Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription