backbone.js Collection Collection.url()


Example

By default, the url property is not defined. Calling fetch() (while using the default Backbone.sync) will result in a GET request to the results of url.

var Users = Backbone.Collection.extend({

  url: '/api/users',
  
  // or
  
  url: function () {
    return '/api/users'
  }

});

var users = new Users();
users.fetch() // GET http://webroot/api/users