Backbone.js - Dynamic routing for a large site
backbone-routing, backbone.js, requirejs
Solution
I wrote a blog post about this very topic. The single-router approach might work for awhile, but you're right to worry about scalability issues in the future.
As @schacki mentioned above, check out my Backbone.Subroute plugin to make this more scalable, and transfer the burdon of subroutes to the developers working on those modules.
Problem
I am planning to use backbone + require for an application which has more than 30 modules. Instead of creating separate route for each module, I am planning to create something like this. Not sure it this is a best practice. Please guide. ``` routes: { ":module" : "routeLevelOne", ":module/:id" : "routeLevelTwo", }, routeLevelOne: function(module){ require(['views/' + module + 'View',], function(){ require('views/' + module + 'View').render(); } ); }, routeLevelTwo: function(module, id){ require(['views/' + module + 'View',], function(){ require('views/' + module + 'View').renderWithId(id); } ); }, ```