Permalink
Browse files

Updates to the snap bench source.

  • Loading branch information...
1 parent fb7d87c commit 2bef124f3aaf18707e9f2dcfefea8c75e27b55f0 @mightybyte mightybyte committed Oct 26, 2010
Showing with 9 additions and 15 deletions.
  1. +2 −4 snap-bench/snap-bench.cabal
  2. +6 −6 snap-bench/src/pong.hs
  3. +1 −5 snap-bench/src/table.hs
@@ -20,10 +20,9 @@ Executable pong-server
bytestring,
snap-core,
snap-server,
- heist,
filepath
- ghc-options: -O2 -Wall -fwarn-tabs -funbox-strict-fields -threaded -fno-warn-unused-imports
+ ghc-options: -O2 -Wall -fwarn-tabs -funbox-strict-fields -threaded -fno-warn-unused-imports -rtsopts
Extensions: OverloadedStrings
@@ -39,9 +38,8 @@ Executable table-server
bytestring,
snap-core,
snap-server,
- heist,
filepath
- ghc-options: -O2 -Wall -fwarn-tabs -funbox-strict-fields -threaded -fno-warn-unused-imports
+ ghc-options: -O2 -Wall -fwarn-tabs -funbox-strict-fields -threaded -fno-warn-unused-imports -rtsopts
Extensions: OverloadedStrings
@@ -7,10 +7,10 @@ import Snap.Http.Server
import Snap.Iteratee
import Snap.Types
import Snap.Util.FileServe
-import Text.Templating.Heist
site :: Snap ()
site = dir "pong" (writeBS "PONG") <|> fileServe "static"
+--site = writeBS "PONG"
pongServer :: Snap ()
pongServer = --dir "pong" $
@@ -22,9 +22,9 @@ main :: IO ()
main = do
args <- getArgs
let port = case args of
- [] -> 8000
+ [] -> 3000
p:_ -> read p
- httpServe "*" port "myserver"
- Nothing -- (Just "access.log")
- Nothing -- (Just "error.log")
- site
+ config = setPort port $
+ setAccessLog Nothing $
+ defaultConfig
+ httpServe config site
@@ -8,7 +8,6 @@ import Snap.Http.Server
import Snap.Iteratee
import Snap.Types
import Snap.Util.FileServe
-import Text.Templating.Heist
tableRow :: Int -> Snap ()
@@ -43,7 +42,4 @@ main = do
let port = case args of
[] -> 8000
p:_ -> read p
- httpServe "*" port "myserver"
- Nothing -- (Just "access.log")
- Nothing -- (Just "error.log")
- tableServer
+ httpServe (setPort port defaultConfig) tableServer

0 comments on commit 2bef124

Please sign in to comment.