Robert Massaioli
Robert Massaioli

Reputation: 13487

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?

Upvotes: 1

Views: 128

Answers (1)

Robert Massaioli
Robert Massaioli

Reputation: 13487

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.

Upvotes: 3

Related Questions