Created
December 9, 2016 23:40
-
-
Save Profpatsch/a627cf285d3713680c692187804a5314 to your computer and use it in GitHub Desktop.
Like python’s SimpleHTTPServer, but using the fastest webserver on this planet instead.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env nix-shell | |
#!nix-shell -i runhaskell -p "haskellPackages.ghcWithPackages (hps: with hps; [wai-middleware-static warp])" | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Network.Wai | |
import Network.Wai.Middleware.Static | |
import Network.Wai.Handler.Warp | |
import Network.HTTP.Types.Status | |
main = | |
runEnv 8000 $ static $ \req resp -> resp $ responseLBS notFound404 [] "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment