Front-end aspects
I used backbone.js to do the front-end development, the impression is that the backend by the properties of the model object to send the JSON data, I write in the template rendering is good
- Template loading (underscore.js)
- Building a model
- Render View
- Routing, events, etc.
Back-end aspects
The two days of contact with Nodejs, originally intended to use Backbone to do the front-end structure, and then use the Nodejs for server development (using the Express framework), connect the database to the front end, but in the online search for information in the Nodejs template to write the front end, in the place of rendering such as
function (req, res) {Res.render (' index ', {title: ' Hey ', message: ' Hello there! ') });});
The second parameter of render is very much like the properties of the model in Backbone, and the data can be loaded directly with Mongoose to connect to Mongodb. That is not with Backbone with Nodejs of time Backbone inside of model module and render do not need to use? So I feel Backbone is useless?
Of course, what I said is probably wrong, I just want to know where I understand the problem. My question is as follows:
- Backbone with Nodejs when the model module and render can be directly replaced by the similar module in Express?
- Backbone and Nodejs in tune? What is the best way to use it?
- Why is backbone.js suitable for single page development? Because of its routing?
Backbone.js and Nodejs have something in common that they don't know.