I\'m now a front-end developer, and I have a project which is fine to use BackboneJS, and the server-side is written by others. Is there anyone who can tell me how to override
The best option in your case is plugin like Backbone.service. It is Backbone service for non restful or semi restful apis.
// define server targets / endpoints
var targets = {
login: ["/login", "post"],
signup: ["/signup", "post"],
logout: ["/logout", "get"],
search: "/search" // defaults to get
resetPassword: ["/resetpassword", "post"],
updateSettings: ["/updateSettings", "post"]
};
// standalone service
var service = new Backbone.Service({ url: "http://localhost:5000", targets: targets });
// extend backbone model
var User = Backbone.Model.extend(service);
You can use it like this:
var user = new User();
user.login({ username: 'bob', password: 'secret' });