I'm just starting out in Haskell and Yesod. To get my feet wet, I'm going to convert a small project that I wrote in MVC into Haskell. My first step was just to get all the routes defined.
All told, I have 8 handlers to make this project run. My routes file looks like this:
/activity ActivityR GET
/activity/#String ActivityItemR POST DELETE
/dashboard/month MonthDashboardR GET
/dashboard/year YearDashboardR GET
/calendar CalendarR GET
/events/calendar CalendarEventsR GET
/events/report ReportEventsR GET
/report ReportR GET
The flow I went through in adding these routes went like this:
Is there a shortcut, or way to wildcard these handlers so that I could do something like Import Handler.*
Or is the preferred way to have fewer handler modules that handle multiple different routes?
The yesod
command line tool provides the command add-handler
which will automate much of this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With