Snap framework root (“/”) route not being handed?

六月ゝ 毕业季﹏ 提交于 2019-12-23 01:59:05

问题


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?


回答1:


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)

Edit: 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.



来源:https://stackoverflow.com/questions/26597971/snap-framework-root-route-not-being-handed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!