Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default route #1

Closed
tmjfitch opened this issue Feb 1, 2012 · 5 comments
Closed

default route #1

tmjfitch opened this issue Feb 1, 2012 · 5 comments

Comments

@tmjfitch
Copy link

tmjfitch commented Feb 1, 2012

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
Copy link
Owner

tbranyen commented Feb 1, 2012

Did you run the application through the provided server?

@tmjfitch
Copy link
Author

tmjfitch commented Feb 1, 2012

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
Copy link
Owner

tbranyen commented Feb 1, 2012

@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.

@tbranyen tbranyen closed this as completed Feb 1, 2012
@tmjfitch
Copy link
Author

tmjfitch commented Feb 1, 2012

@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
Copy link
Owner

tbranyen commented Feb 1, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants