Added static example

This commit is contained in:
Michael Snoyman 2010-04-13 21:19:17 -07:00
parent 4163c55e0d
commit aa2cc2f0eb

24
examples/static.hs Normal file
View File

@ -0,0 +1,24 @@
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
import Yesod
import Yesod.Helpers.Static
import Network.Wai.Handler.SimpleServer
data StaticExample = StaticExample
mkYesod "StaticExample" [$parseRoutes|
/ Root StaticRoutes siteStaticRoutes getStaticSite
|]
instance Yesod StaticExample where
approot _ = "http://localhost:3000"
getStaticSite :: StaticExample -> Static
getStaticSite _ = fileLookupDir "dist/doc/html/yesod"
main :: IO ()
main = do
putStrLn "Running..."
toWaiApp StaticExample >>= run 3000