X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=examples%2FMultipart.hs;h=8ddc6189be39a8ad942d372671819fd6f066e53f;hb=3eb69879d3b336c7c3e613c0ce4bfb3c67989ff3;hp=6c15cd3a8a4ab1130737c1c770983892edb2d596;hpb=e2a6ee839c0ca27b25b32656a5c080e4b464e7c9;p=Lucu.git diff --git a/examples/Multipart.hs b/examples/Multipart.hs index 6c15cd3..8ddc618 100644 --- a/examples/Multipart.hs +++ b/examples/Multipart.hs @@ -1,38 +1,41 @@ -import Data.List +{-# LANGUAGE + OverloadedStrings + , UnicodeSyntax + #-} +import qualified Data.ByteString.Lazy.Char8 as Lazy +import Control.Applicative +import Control.Monad.Unicode import Data.Maybe -import Network +import Data.Monoid.Unicode import Network.HTTP.Lucu -main :: IO () -main = let config = defaultConfig { cnfServerPort = PortNumber 9999 } +main â· IO () +main = let config = defaultConfig { cnfServerPort = "9999" } resources = mkResTree [ ([], resMain) ] in do putStrLn "Access http://localhost:9999/ with your browser." runHttpd config resources [] -resMain :: ResourceDef +resMain â· ResourceDef resMain - = ResourceDef { - resUsesNativeThread = False - , resIsGreedy = False - , resGet - = Just $ do setContentType $ read "text/html" - output ("