Permalink
Browse files

Merge pull request #3 from favonia/master

Make snap-bench buildable against newer Snap.
  • Loading branch information...
2 parents 3d088d1 + a22d088 commit 8af81f0157218c56f219db23a586278f0e2515f2 @mightybyte mightybyte committed Feb 18, 2013
Showing with 14 additions and 15 deletions.
  1. +0 −3 snap-bench/snap-bench.cabal
  2. +6 −5 snap-bench/src/file.hs
  3. +5 −4 snap-bench/src/pong.hs
  4. +3 −3 snap-bench/src/table.hs
@@ -14,7 +14,6 @@ Executable pong-server
Build-depends:
base >= 4,
- haskell98,
transformers,
mtl,
bytestring,
@@ -32,7 +31,6 @@ Executable file-server
Build-depends:
base >= 4,
- haskell98,
transformers,
mtl,
bytestring,
@@ -51,7 +49,6 @@ Executable table-server
Build-depends:
base >= 4,
blaze-builder,
- haskell98,
transformers,
mtl,
bytestring,
View
@@ -1,23 +1,24 @@
module Main where
-import System
+import System.Environment
import Control.Applicative
import Control.Monad.Trans
import Snap.Http.Server
import Snap.Iteratee
-import Snap.Types
+import Snap.Core
import Snap.Util.FileServe
site :: Snap ()
-site = fileServe "static"
+site = serveFile "static"
main :: IO ()
main = do
args <- getArgs
let port = case args of
[] -> 3000
p:_ -> read p
- config = addListen (ListenHttp "0.0.0.0" port) $
- setAccessLog Nothing $
+ config = setBind "0.0.0.0" $
+ setPort port $
+ setAccessLog ConfigNoLog $
defaultConfig
httpServe config site
View
@@ -1,11 +1,11 @@
module Main where
-import System
+import System.Environment
import Control.Applicative
import Control.Monad.Trans
import Snap.Http.Server
import Snap.Iteratee
-import Snap.Types
+import Snap.Core
import Snap.Util.FileServe
site :: Snap ()
@@ -17,7 +17,8 @@ main = do
let port = case args of
[] -> 3000
p:_ -> read p
- config = addListen (ListenHttp "0.0.0.0" port) $
- setAccessLog Nothing $
+ config = setBind "0.0.0.0" $
+ setPort port $
+ setAccessLog ConfigNoLog $
defaultConfig
httpServe config site
View
@@ -2,7 +2,7 @@
module Main where
-import System
+import System.Environment
import Blaze.ByteString.Builder
import Blaze.ByteString.Builder.Char8
import Control.Applicative
@@ -11,7 +11,7 @@ import qualified Data.ByteString.Char8 as BS
import Data.Monoid
import Snap.Http.Server
import Snap.Iteratee
-import Snap.Types
+import Snap.Core
import Snap.Util.FileServe
@@ -60,4 +60,4 @@ main = do
let port = case args of
[] -> 8000
p:_ -> read p
- httpServe (addListen (ListenHttp "0.0.0.0" port) defaultConfig) tableServer
+ httpServe (setBind "0.0.0.0" . setPort port $ defaultConfig) tableServer

0 comments on commit 8af81f0

Please sign in to comment.