on master help sign in
Remove warp-static
commitb91db70765658c3ef99ae38ff42511f3a826839f authorMichael Snoyman <michael@snoyman.com> dateFri 21 Mar 2014, 14:34 (13 years ago) parentab1ed48
6 files changed−112
sources.txt−1 warp-static/LICENSE−20 warp-static/README warp-static/Setup.lhs−7 warp-static/warp-static.cabal−31 warp-static/warp.hs−53
sources.txt−1
@@ -8,7 +8,6 @@
88./wai-handler-launch
99./wai-handler-scgi
1010./wai-frontend-monadcgi
11−./warp-static
1211./wai-websockets
1312./wai-eventsource
1413./mime-types
warp-static/LICENSEdeleted−20
@@ -1,20 +0,0 @@
1−Copyright (c) 2012 Michael Snoyman, http://www.yesodweb.com/
2−
3−Permission is hereby granted, free of charge, to any person obtaining
4−a copy of this software and associated documentation files (the
5−"Software"), to deal in the Software without restriction, including
6−without limitation the rights to use, copy, modify, merge, publish,
7−distribute, sublicense, and/or sell copies of the Software, and to
8−permit persons to whom the Software is furnished to do so, subject to
9−the following conditions:
10−
11−The above copyright notice and this permission notice shall be
12−included in all copies or substantial portions of the Software.
13−
14−THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15−EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16−MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17−NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18−LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19−OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20−WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
warp-static/READMEdeleted

No changes to the content.

warp-static/Setup.lhsdeleted−7
@@ -1,7 +0,0 @@
1−#!/usr/bin/env runhaskell
2−
3−> module Main where
4−> import Distribution.Simple
5−
6−> main :: IO ()
7−> main = defaultMain
warp-static/warp-static.cabaldeleted−31
@@ -1,31 +0,0 @@
1−Name: warp-static
2−Version: 2.0.1.1
3−Synopsis: Static file server based on Warp and wai-app-static (deprecated)
4−description: This executable is now provided by wai-app-static.
5−Homepage: http://github.com/yesodweb/wai
6−License: MIT
7−License-file: LICENSE
8−Author: Michael Snoyman
9−Maintainer: michael@snoyman.com
10−Category: Web
11−Build-type: Simple
12−Cabal-version: >=1.6
13−Description: Serve up static files by running the warp executable. Based on Warp and wai-app-static.
14−
15−
16−Executable warp
17− Main-is: warp.hs
18− Build-depends: base >= 4 && < 5
19− , warp >= 2.0 && < 2.2
20− , wai-app-static >= 2.0 && < 2.1
21− , wai-extra >= 2.0 && < 2.2
22− , cmdargs >= 0.6.7
23− , directory >= 1.0
24− , containers >= 0.2
25− , bytestring >= 0.9.1.4
26− , text >= 0.7
27− , mime-types >= 0.1 && < 0.2
28−
29−source-repository head
30− type: git
31− location: git://github.com/yesodweb/wai.git
warp-static/warp.hsdeleted−53
@@ -1,53 +0,0 @@
1−{-# LANGUAGE DeriveDataTypeable, RecordWildCards #-}
2−import Network.Wai.Application.Static (staticApp, defaultFileServerSettings)
3−import Network.Wai.Handler.Warp
4− ( runSettings, defaultSettings, settingsHost, settingsPort
5− )
6−import System.Console.CmdArgs hiding (def)
7−import Text.Printf (printf)
8−import System.Directory (canonicalizePath)
9−import Control.Monad (unless)
10−import Network.Wai.Middleware.Autohead
11−import Network.Wai.Middleware.RequestLogger (logStdout)
12−import Network.Wai.Middleware.Gzip
13−import qualified Data.Map as Map
14−import qualified Data.ByteString.Char8 as S8
15−import Control.Arrow ((***))
16−import Data.Text (pack)
17−import Data.String (fromString)
18−import Network.Mime (defaultMimeMap, mimeByExt, defaultMimeType)
19−import WaiAppStatic.Types (ssIndices, toPiece, ssGetMimeType, fileName, fromPiece)
20−import Data.Maybe (mapMaybe)
21−
22−data Args = Args
23− { docroot :: FilePath
24− , index :: [FilePath]
25− , port :: Int
26− , noindex :: Bool
27− , quiet :: Bool
28− , verbose :: Bool
29− , mime :: [(String, String)]
30− , host :: String
31− }
32− deriving (Show, Data, Typeable)
33−
34−defaultArgs :: Args
35−defaultArgs = Args "." ["index.html", "index.htm"] 3000 False False False [] "*"
36−
37−main :: IO ()
38−main = do
39− Args {..} <- cmdArgs defaultArgs
40− let mime' = map (pack *** S8.pack) mime
41− let mimeMap = Map.fromList mime' `Map.union` defaultMimeMap
42− docroot' <- canonicalizePath docroot
43− unless quiet $ printf "Serving directory %s on port %d with %s index files.\n" docroot' port (if noindex then "no" else show index)
44− let middle = gzip def { gzipFiles = GzipCompress }
45− . (if verbose then logStdout else id)
46− . autohead
47− runSettings defaultSettings
48− { settingsPort = port
49− , settingsHost = fromString host
50− } $ middle $ staticApp (defaultFileServerSettings $ fromString docroot)
51− { ssIndices = if noindex then [] else mapMaybe (toPiece . pack) index
52− , ssGetMimeType = return . mimeByExt mimeMap defaultMimeType . fromPiece . fileName
53− }