-main :: IO ()
-main = let config = defaultConfig { cnfServerPort = PortNumber 9999 }
- resources = mkResTree [ ([], helloWorld) ]
+main ∷ IO ()
+main = let config = def { cnfServerPort = "9999" }
+ mapper = resourceMap resources ⊕ resourceMap fallbacks
+ resources ∷ ResourceTree
+ resources = C.fromList
+ [ ([] , nonGreedy helloWorld)
+ , (["urandom" ], nonGreedy $ staticFile "/dev/urandom")
+ , (["inc" ], greedy $ staticDir "/usr/include")
+ , (["inc", "t"], nonGreedy $ staticFile "/usr/include/time.h")
+ ]
+ fallbacks ∷ Path → Maybe (Path, Resource)
+ fallbacks path
+ | path ≡ ["hello"] = Just (path, helloWorld)
+ | otherwise = Nothing