import Control.Applicative
import qualified Data.Collections as C
import Control.Monad.Unicode
+import Data.Default
import Data.Maybe
import Data.Monoid.Unicode
import Network
import Text.Blaze.Renderer.Utf8
main ∷ IO ()
-main = let config = defaultConfig { cnfServerPort = "9999" }
+main = let config = def { cnfServerPort = "9999" }
tree ∷ ResourceTree
tree = C.fromList [ ([], nonGreedy resMain) ]
in
let text = fromMaybe (∅) $ fdContent <$> lookup "text" f
file = fromMaybe (∅) $ fdContent <$> lookup "file" f
fileName = fdFileName =≪ lookup "file" f
- setContentType $ parseMIMEType "text/plain"
+ setContentType [mimeType| text/plain |]
putChunks $ "You entered \"" ⊕ text ⊕ "\".\n"
putChunks $ "You uploaded a " ⊕ Lazy.pack (show $ Lazy.length file) ⊕ " bytes long file.\n"
putChunks $ "The file name is " ⊕ Lazy.pack (show fileName) ⊕ ".\n"