Reputation: 161
I'm a Yesod beginner, and want to build a web site which mainly constructed with static files.
It's required to put static files on /
, and dynamic page on /foo
.
So I prepared static files in static
directory
(e.g., static/index.html, static/img/bar.gif, static/css/baz.css, ...),
and wrote config/routes
as follows:
/ StaticR Static getStatic
/foo FooR GET POST
Ghc claims that
Exception when trying to run compile-time code:
Overlapping routes:
("StaticR","FooR")
How can I resolve this?
Upvotes: 1
Views: 791
Reputation: 31345
ms's comment is correct: you should put FooR
before StaticR
. In addition, you'll need to turn off overlap checking. The easiest way is probably to use parseRoutesFileNoCheck
instead of parseRoutesFile
(or parseRoutesNoCheck
instead of parseRoutes
if you're using the quasiquoter).
Upvotes: 5