tbranyen / github-viewer

GitHub Viewer.
MIT License
366 stars 59 forks source link

default route #1

Closed tmjfitch closed 12 years ago

tmjfitch commented 12 years ago

The code in index.js:

routes: { "": "index" }

didn't work for me. I'm a newbie to backbone.js but I tried using:

routes: { "*path": "index" }

to make a default route and it appears to be working.

tbranyen commented 12 years ago

Did you run the application through the provided server?

tmjfitch commented 12 years ago

I tried running the demo app, and that worked fine (with its minified and uglified code though stepping through was not easy). When I downloaded the source and tried running it though the app failed. Blank page, and I added a console.log('hi') into the default router (index function). It never got hit.

When I added the above fix with *path instead of a blank string it worked fine.

tbranyen commented 12 years ago

@tmjfitch how did you run the app? Did you use the node build server command? If not, you'll need to set the root property in the Backbone.history.start

The route doesn't need to be changed.

tmjfitch commented 12 years ago

@tbranyen Thanks Tim, like I said, I'm a backbone newb :) for now I'll set the Backbone.history.start value and work up to building with node.

tbranyen commented 12 years ago

No problem man, lemme know if that doesn't work.