Skip to content

Instantly share code, notes, and snippets.

@xaviershay
Created April 8, 2011 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xaviershay/909264 to your computer and use it in GitHub Desktop.
Save xaviershay/909264 to your computer and use it in GitHub Desktop.
{-# 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