Created
January 4, 2015 08:46
-
-
Save b0oh/7e2ec5baffc26dc5a09e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE QuasiQuotes #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| import Yesod | |
| data Links = Links | |
| mkYesod "Links" [parseRoutes| | |
| / HomeR GET | |
| /page1 Page1R GET | |
| /page2 Page2R GET | |
| |] | |
| instance Yesod Links | |
| getHomeR = defaultLayout [whamlet|<a href=@{Page1R}>Go to the page 1|] | |
| getPage1R = defaultLayout [whamlet|<a href=@{Page2R}>Go to the page 2|] | |
| getPage2R = defaultLayout [whamlet|<a href=@{HomeR}>Go to the home|] | |
| main = warp 3000 Links |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment