on master help sign in
Merge remote-tracking branch 'origin/master'
commit5eef19d310a2f0a7f91a50ee7fa0dd7acd252314 authorMichael Snoyman <michael@snoyman.com> dateFri 6 Jan 2012, 12:58 (15 years ago) parent91bf6ac73edd4a
11 files changed+13−193
images−1 test/a−1 test/main.hs−8 test/requests−1 test/test−1 test/wai-app-static−1 test/wai-extra−1 wai-extra/Network/Wai/Middleware/RequestLogger.hs+2 wai-handler-launch/Network/Wai/Handler/Launch.hs+11−7 wai-handler-launch/wai-handler-launch.cabal−1 wai-mega.cabal−171
imagesdeleted−1
@@ -1 +0,0 @@
1−wai-app-static/images
test/adeleted−1
@@ -1 +0,0 @@
1−../wai-app-static/test/a
test/main.hsdeleted−8
@@ -1,8 +0,0 @@
1−import qualified WaiAppStaticTest
2−import qualified WaiExtraTest
3−import Test.Hspec.Monadic
4−
5−main :: IO a
6−main = hspecX $ do
7− WaiAppStaticTest.specs
8− WaiExtraTest.specs
test/requestsdeleted−1
@@ -1 +0,0 @@
1−../wai-extra/test/requests
test/testdeleted−1
@@ -1 +0,0 @@
1−../wai-app-static/test
test/wai-app-staticdeleted−1
@@ -1 +0,0 @@
1−../wai-app-static/test
test/wai-extradeleted−1
@@ -1 +0,0 @@
1−../wai-extra/test
wai-extra/Network/Wai/Middleware/RequestLogger.hs+2
@@ -47,6 +47,7 @@ logHandle cb app req = do
4747 , " "
4848 , "Accept: "
4949 , maybe "" toBS $ lookup "Accept" $ requestHeaders req
50+ , "\n"
5051 ]
5152 app req
5253
@@ -85,6 +86,7 @@ logHandleDev cb app req = do
8586 , maybe "" id $ lookup "Accept" $ requestHeaders req
8687 , paramsToBS "GET " getParams
8788 , paramsToBS "POST " postParams
89+ , "\n"
8890 ]
8991 -- we just consumed the body- fill the enumerator back up so it is available again
9092 body' <- C.bufferSource $ CL.sourceList body
wai-handler-launch/Network/Wai/Handler/Launch.hs+11−7
@@ -4,6 +4,7 @@
44module Network.Wai.Handler.Launch
55 ( run
66 , runUrl
7+ , runUrlPort
78 ) where
89
910import Network.Wai
@@ -105,32 +106,35 @@ foreign import ccall "launch"
105106 launch' :: Int -> CString -> IO ()
106107#endif
107108
108−launch :: String -> IO ()
109+launch :: Int -> String -> IO ()
109110
110111#if WINDOWS
111−launch s = withCString s $ launch' 4587
112+launch port s = withCString s $ launch' port
112113#else
113−launch s = forkIO (rawSystem
114+launch port s = forkIO (rawSystem
114115#if MAC
115116 "open"
116117#else
117118 "xdg-open"
118119#endif
119− ["http://127.0.0.1:4587/" ++ s] >> return ()) >> return ()
120+ ["http://127.0.0.1:" ++ show port ++ "/" ++ s] >> return ()) >> return ()
120121#endif
121122
122123run :: Application -> IO ()
123124run = runUrl ""
124125
125126runUrl :: String -> Application -> IO ()
126−runUrl url app = do
127+runUrl = runUrlPort 4587
128+
129+runUrlPort :: Int -> String -> Application -> IO ()
130+runUrlPort port url app = do
127131 x <- newIORef True
128132 _ <- forkIO $ Warp.runSettings Warp.defaultSettings
129− { Warp.settingsPort = 4587
133+ { Warp.settingsPort = port
130134 , Warp.settingsOnException = const $ return ()
131135 , Warp.settingsHost = "127.0.0.1"
132136 } $ ping x app
133− launch url
137+ launch port url
134138 loop x
135139
136140loop :: IORef Bool -> IO ()
wai-handler-launch/wai-handler-launch.cabal−1
@@ -1,4 +1,3 @@
1−Name: wai-handler-launch
21Version: 1.0.0
32Synopsis: Launch a web app in the default browser.
43Description: This handles cross-platform launching and inserts Javascript code to ping the server. When the server no longer receives pings, it shuts down.
wai-mega.cabaldeleted−171
@@ -1,171 +0,0 @@
1−Name: wai-mega
2−Version: 0.4.2
3−Synopsis: WAI mega install
4−Description: Provides a common protocol for communication between web applications and web servers.
5−License: BSD3
6−License-file: LICENSE
7−Author: Michael Snoyman
8−Maintainer: michael@snoyman.com
9−Homepage: https://github.com/yesodweb/wai
10−Category: Web
11−Build-Type: Simple
12−Cabal-Version: >= 1.8
13−Stability: Stable
14−
15−Source-repository head
16− type: git
17− location: git://github.com/yesodweb/wai.git
18−
19−Library
20− cpp-options: -DMEGA
21− hs-source-dirs:
22− wai
23− wai-app-static
24− wai-eventsource
25− wai-extra
26− wai-handler-devel
27− wai-handler-fastcgi
28− wai-handler-launch
29− wai-handler-scgi
30− wai-handler-webkit
31− wai-test
32− wai-websockets
33− warp
34− warp-static
35−
36− Build-Depends: base >= 4 && < 5
37−
38− -- wai-handler-scgi
39− -- wai-handler-launch
40− , process >= 1.0 && < 1.2
41− -- warp-static
42−
43− -- warp
44− , simple-sendfile >= 0.1 && < 0.2
45−
46− -- wai-websockets
47− , network-enumerator >= 0.1.2 && < 0.2
48− , websockets >= 0.4 && < 0.5
49−
50− -- wai-test
51− , cookie >= 0.2 && < 0.4
52− , HUnit >= 1.2 && < 1.3
53− , case-insensitive >= 0.2 && < 0.4
54−
55− -- wai-handler-devel
56− , hint >= 0.3.2.3 && < 0.4
57− , text >= 0.7 && < 0.12
58− , old-time >= 1.0 && < 1.1
59− , attoparsec >= 0.10
60−
61− -- wai-extra
62− , wai >= 0.4 && < 0.5
63− , old-locale >= 1.0 && < 1.1
64− , network >= 2.2.1.5 && < 2.4
65− , directory >= 1.0.1 && < 1.2
66− , zlib-bindings >= 0.0 && < 0.1
67− , blaze-builder-enumerator >= 0.2 && < 0.3
68− , case-insensitive >= 0.2 && < 0.4
69− , zlib-enum >= 0.2.1 && < 0.3
70− , data-default >= 0.3 && < 0.4
71−
72− -- wai-app-static
73− , bytestring >= 0.9.1.4 && < 0.10
74− , http-types >= 0.6 && < 0.7
75− , transformers >= 0.2.2 && < 0.3
76− , unix-compat >= 0.2 && < 0.3
77− , containers >= 0.2 && < 0.5
78− , blaze-html >= 0.4 && < 0.5
79− , time >= 1.1.4 && < 1.4
80− , old-locale >= 1.0.0.2 && < 1.1
81− , file-embed >= 0.0.3.1 && < 0.1
82− , blaze-builder >= 0.2.1.4 && < 0.4
83− , base64-bytestring >= 0.1 && < 0.2
84− , cryptohash >= 0.7 && < 0.8
85− , http-date
86−
87− -- wai
88− , enumerator >= 0.4.8 && < 0.5
89− , http-types >= 0.6 && < 0.7
90− , text >= 0.5 && < 1.0
91−
92− Exposed-modules:
93− -- warp-static
94−
95− -- warp
96− Network.Wai.Handler.Warp
97−
98− -- wai-websockets
99− Network.Wai.Handler.WebSockets
100−
101− -- wai-test
102− Network.Wai.Test
103−
104− -- wai-handler-webkit
105− Network.Wai.Handler.Webkit
106−
107− -- wai-handler-scgi
108− Network.Wai.Handler.SCGI
109−
110− -- wai-handler-launch
111− Network.Wai.Handler.Launch
112−
113− -- wai-handler-fastcghi
114− Network.Wai.Handler.FastCGI
115−
116− -- wai-app-static
117− Network.Wai.Application.Static
118−
119− --wai
120− Network.Wai
121−
122− -- wai-handler-devel
123− Network.Wai.Handler.DevelServer
124− Network.Wai.Application.Devel
125−
126− -- wai-extra
127− Network.Wai.Handler.CGI
128− Network.Wai.Middleware.AcceptOverride
129− Network.Wai.Middleware.Autohead
130− Network.Wai.Middleware.CleanPath
131− Network.Wai.Middleware.Debug
132− Network.Wai.Middleware.Gzip
133− Network.Wai.Middleware.Jsonp
134− Network.Wai.Middleware.MethodOverride
135− Network.Wai.Middleware.Rewrite
136− Network.Wai.Middleware.Vhost
137− Network.Wai.Zlib
138− Network.Wai.Parse
139−
140− ghc-options: -Wall
141−
142−test-suite test
143− hs-source-dirs:
144− test
145− test/wai-app-static
146− test/wai-extra
147−
148− main-is: main.hs
149− type: exitcode-stdio-1.0
150−
151− build-depends: base >= 4 && < 5
152− , wai-mega
153− , hspec >= 0.8 && < 0.10
154− , HUnit
155− , unix-compat >= 0.2 && < 0.3
156− , time >= 1.1.4 && < 1.4
157− , old-locale >= 1.0.0.2 && < 1.1
158− , http-date
159− , http-types
160− , network
161− , bytestring
162− , text
163− , transformers
164− , enumerator
165− , zlib
166− , directory
167− , zlib-bindings
168− , blaze-builder-enumerator >= 0.2 && < 0.3
169− , blaze-builder >= 0.2.1.4 && < 0.4
170− , zlib-enum
171− , data-default