So I don't use any backbone logic until the user logs into the app. So for using node.js the application starts on localhost:3000
and the server handles the routes in this portion. So for example after visiting localhost:3000
there are two options, signup, or login which express handles the engineering of this, and a simple routes.js file handles the logic for these routes. /signup
, /login
That part is all server side, no need for backbone.js at this point in my opinion.
Then finally the user successfully logs into the app, which starts in /profile
that is where I include backbone and my javascripts, here is where I rely more on client side routing and logic because the user is approved to play, and is granted access.
Now being kind of noobish here, but my question is since my app starts inside /profile
why does the router get jacked up? For example I have a chat
route and to invoke this route the url doesn't respect a trailing slash localhost:3000/profile#chat
works but not this localhost:3000/profile/#chat
I read this Backbone.js route optional parameter I tried reversing the syntax but no luck.
Here are my routes
module.exports = Router = Marionette.AppRouter.extend({
appRoutes: {
'' : 'home',
'(/:)chat' : 'chat' // tried playing around here
}
});
So since starting on the /profile
route created by the server how do I get a trailing slash to work?