X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=examples%2FHelloWorld.hs;h=2fb9ed98ccf3a5b381431fa72477765a2351570c;hp=42ccb90ff639c88479a5c241568c40675244be42;hb=1000bdc46cfe7b3ae550ff24ccea9f440f11b42a;hpb=cd1b58b84ff354e3fc2a7d2c8fd548a7b59fe138 diff --git a/examples/HelloWorld.hs b/examples/HelloWorld.hs index 42ccb90..2fb9ed9 100644 --- a/examples/HelloWorld.hs +++ b/examples/HelloWorld.hs @@ -1,11 +1,16 @@ +import Control.Monad.Trans import Data.Maybe import Network import Network.HTTP.Lucu.Config +import Network.HTTP.Lucu.ETag import Network.HTTP.Lucu.Httpd +import Network.HTTP.Lucu.Parser +import Network.HTTP.Lucu.Parser.Http import Network.HTTP.Lucu.Resource import Network.HTTP.Lucu.Response import Network.URI import System.Posix.Signals +import System.Time main :: IO () main = let config = defaultConfig { cnfServerPort = PortNumber 9999 } @@ -21,7 +26,9 @@ helloWorld resUsesNativeThread = False , resIsGreedy = False , resGet - = Just $ do setHeader "Content-Type" "text/plain" + = Just $ do time <- liftIO $ getClockTime + foundEntity False "abcde" time + setHeader "Content-Type" "text/plain" outputChunk "Hello, " outputChunk "World!\n" , resHead = Nothing