Permalink
Browse files

Make snap-bench buildable against newer Snap.

  • Loading branch information...
1 parent 3d088d1 commit a22d08865a2b70e44fdf42b584db67b68cfe2d59 @favonia favonia 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,
@@ -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
@@ -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
@@ -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 a22d088

Please sign in to comment.