Webanwendung mit FastCGI und Haskell
No puede seleccionar más de 25 temas
Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
|
- {-# LANGUAGE OverloadedStrings #-}
-
- import qualified Data.ByteString as B
- import Blaze.ByteString.Builder (toByteStringIO)
- import Control.Applicative
- import Control.Monad.Trans.Either (runEitherT)
- import Heist
- import Heist.Compiled (renderTemplate)
- import Control.Lens
-
- heistConfig =
- (set hcNamespace "") $
- -- (set hcInterpretedSplices defaultInterpretedSplices) $
- (set hcLoadTimeSplices defaultLoadTimeSplices) $
- (set hcTemplateLocations [loadTemplates "."]) $
- emptyHeistConfig
-
- main = do
- heistState <- either (error "oops") id <$>
- (runEitherT $ initHeist heistConfig)
- builder <- maybe (error "oops") fst $
- renderTemplate heistState "billy"
- toByteStringIO B.putStr builder
|