-- | This is a very simple fileserver HTTP server which serves from the current
--   directory. It will handle If-Modified-Since and Range requests etc. It
--   doesn't do directory indexes yet, so GETting '/' will give a 404
module Main where

import Network.MiniHTTP.Server

main = serve 4112 $ do
  handleFromFilesystem "."
  handleConditionalRequest
  handleRangeRequests
  handleDecoration

-- If you wanted to process some URLs differently, you would do something like:
--   req <- getRequest
--   if iWantToHandle $ reqUrl req
--      then xyx
--      else handleFromFilesystem "."
--   handleConditionalRequest
--   ...