-- tree :: 'ResourceTree'
-- tree = C.fromList [ ([], 'nonGreedy' helloWorld) ]
-- in
--- 'Network.withSocketsDo' '$' 'runHttpd' config '$' 'resourceMap' tree
+-- 'Network.withSocketsDo' '.' 'runHttpd' config '$' 'resourceMap' tree
--
-- helloWorld :: 'Network.HTTP.Lucu.Resource'
-- helloWorld = C.fromList
-- main :: 'IO' ()
-- main = let tree :: 'Network.HTTP.Lucu.ResourceTree'
-- tree = 'fromList' [ (["foo"], 'Network.HTTP.Lucu.greedy' resFoo) ]
--- in 'Network.HTTP.Lucu.runHttpd' 'defaultConfig' $ 'Network.HTTP.Lucu.resourceMap' tree
+-- in 'Network.withSocketsDo' '.' 'Network.HTTP.Lucu.runHttpd' 'defaultConfig' $ 'Network.HTTP.Lucu.resourceMap' tree
--
-- resFoo :: 'Resource'
-- resFoo = 'singleton'
import MiseRafturai
import Network
import Network.HTTP.Lucu
+import Prelude.Unicode
main ∷ IO ()
main = let config = defaultConfig { cnfServerPort = "9999" }
tree = C.fromList [ ([], nonGreedy miseRafturai) ]
in
do putStrLn "Access http://localhost:9999/ with your browser."
- withSocketsDo $ runHttpd config $ resourceMap tree
+ withSocketsDo ∘ runHttpd config $ resourceMap tree
import qualified Data.Collections as C
import Network
import Network.HTTP.Lucu
+import Prelude.Unicode
import SmallFile
main ∷ IO ()
tree = C.fromList [ ([], nonGreedy smallFile) ]
in
do putStrLn "Access http://localhost:9999/ with your browser."
- withSocketsDo $ runHttpd config $ resourceMap tree
+ withSocketsDo ∘ runHttpd config $ resourceMap tree
import Data.Monoid.Unicode
import Network
import Network.HTTP.Lucu
+import Prelude.Unicode
main ∷ IO ()
main = let config = defaultConfig { cnfServerPort = "9999" }
tree = C.fromList [ ([], nonGreedy resMain) ]
in
do putStrLn "Access http://localhost:9999/ with your browser."
- withSocketsDo $ runHttpd config $ resourceMap tree
+ withSocketsDo ∘ runHttpd config $ resourceMap tree
resMain ∷ Resource
resMain = C.fromList
import OpenSSL.RSA
import qualified OpenSSL.Session as SSL
import OpenSSL.X509
+import Prelude.Unicode
main ∷ IO ()
main = withOpenSSL $
tree ∷ ResourceTree
tree = C.fromList [ ([], nonGreedy helloWorld) ]
putStrLn "Access https://localhost:9001/ with your browser."
- withSocketsDo $ runHttpd config $ resourceMap tree
+ withSocketsDo ∘ runHttpd config $ resourceMap tree
helloWorld ∷ Resource
helloWorld