【发布时间】:2012-12-15 16:00:43
【问题描述】:
我正在使用 Backbone 和 Yeoman 构建一个应用程序。我遇到了路由问题。
我设置了以下路线:
'test' : testMethod,
'' : index
我已经设置了 pushstate:
Backbone.history.start({pushState: true});
我正在使用 Chrome
如果输入 myApp.com#test,则 url 将更改为 myApp.com/test 并且 testMethod() 会正确触发。
但是,如果我尝试直接转到 myApp.com/test 或在浏览器将 url 从 # 更改为 / 后刷新,则会得到 404。
我正在使用 Yeoman 内置服务器来测试页面。这会导致问题吗?
【问题讨论】:
标签: backbone.js yeoman