Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Make snap-bench buildable against newer Snap. #3

Merged
merged 1 commit into from

2 participants

@favonia

No description provided.

@mightybyte mightybyte merged commit 8af81f0 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 18, 2013
  1. @favonia
This page is out of date. Refresh to see the latest.
View
3  snap-bench/snap-bench.cabal
@@ -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
11 snap-bench/src/file.hs
@@ -1,15 +1,15 @@
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
@@ -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
9 snap-bench/src/pong.hs
@@ -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
6 snap-bench/src/table.hs
@@ -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
Something went wrong with that request. Please try again.