Webanwendung mit FastCGI und Haskell
Vous ne pouvez pas sélectionner plus de 25 sujets
Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
|
- {-# 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
|