Snap框架根(" /")路由未被交付? [英] Snap framework root ("/") route not being handed?
问题描述
我添加了以下格式的路线到我的应用程序:
I have added routes to my app in the following format:
addRoutes
[ ("/", redirect "/docs/home")
, ... more routes
]
<但由于某种原因,根处理程序完全被忽略。这里发生了什么?
But for some reason the root handler is being ignored altogether. What is happening here?
推荐答案
事实证明,如果你有一个index.tpl文件,那么SnapFramework将忽略任何 映射并直接转到那个。为了解决这个问题,我只跑了:
It turns out that if you have an index.tpl file then the SnapFramework will ignore any "/" mappings and go straight to that instead. To fix the problem I just ran:
git rm snaplets/heist/templates/index.tpl
然后重新加载我的模板和根目录上的路线开始工作。
And then reloaded my templates and the route on root started working.
(我找不到文档中的任何地方,所以我决定在这里发布)
(I could not find that anywhere in the docs so I decided to post that here)
编辑:我后来发现了(有帮助),问题是我在运行heistInit后添加了路线。如果我在heistInit之前添加了我的路线,那么就没有问题了。
I later discovered (with help) that the problem was that I was adding my routes AFTER I ran heistInit. If i added my routes before heistInit then there was no problem.
这篇关于Snap框架根(" /")路由未被交付?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!