I have built several Backbone apps and appreciate the client-side code structure and organization. I'm moving into Node development, using Express, and I'm uncertain as to how Express and Backbone can work together in the handling of routes.
Express is a routing and middleware web framework that has minimal functionality of its own: An Express application is essentially a series of middleware function calls.
The express. Router() function is used to create a new router object. This function is used when you want to create a new router object in your program to handle requests.
Express. js is the most popular backend framework for Node. js, and it is an extensive part of the JavaScript ecosystem. It is designed to build single-page, multi-page, and hybrid web applications, it has also become the standard for developing backend applications with Node.
The main difference is that express() is a top level function, which means it performs core functionality for the library and it contains its own methods where, as a matter of fact, Router is one, and that is why when we create a specific router we chain the Router() method on express , kind of like how we use app.
You need to understand that Node and Backbone are independent from each other.
You can have a Backbone application in your client-side and it can hook up to any back-end either Node, Rails, PHP etc...
For more info check MVVM pattern and Javascript frameworks on the client-side.
http://backbonetutorials.com/why-would-you-use-backbone/
http://addyosmani.com/blog/understanding-mvvm-a-guide-for-javascript-developers/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With