Commits

rnons  committed 18168c0

warp

  • Participants
  • Parent commits 94dc840

Comments (0)

Files changed (2)

+*~
+*swp
+#!/usr/bin/env runhaskell
+-- Shares all the files in the current folder over HTTP.
+-- Inspired by http://mmb.pcb.ub.es/~carlesfe/unix/tricks.txt
+
+import Filesystem.Path.CurrentOS (decodeString)
+import Network.Wai.Handler.Warp (run)
+import Network.Wai.Application.Static (staticApp, defaultFileServerSettings)
+import System.Directory (getCurrentDirectory)
+ 
+main :: IO ()
+main = do
+    pwd <- getCurrentDirectory
+    let settings = defaultFileServerSettings $ decodeString pwd
+    putStrLn "Serving HTTP on 0.0.0.0 port 3000"
+    run 3000 $  staticApp settings