Created
April 8, 2011 04:08
-
-
Save xaviershay/909264 to your computer and use it in GitHub Desktop.
This file contains 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 TypeFamilies, QuasiQuotes, MultiParamTypeClasses, TemplateHaskell #-} | |
import Yesod | |
import Text.Hamlet | |
import Database.Persist | |
import Database.Persist.MongoDB | |
import Database.MongoDB | |
import Data.ByteString.Lazy.UTF8 | |
import Control.Monad | |
data Links = Links | |
mkYesod "Links" [$parseRoutes| | |
/ HomeR GET | |
|] | |
instance Yesod Links where | |
approot _ = "" | |
getHomeR = defaultLayout $ do | |
--pages <- Database.Persist.MongoDB.select [] [] | |
pages <- Database.MongoDB.select [] [] | |
addHamlet[$hamlet| | |
<h1>Hello | |
|] | |
main = withMongoDBConn "localhost" $ runMongoDBConn $ do | |
warpDebug 3000 $ Links |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment