agrafix / agrafix/Spock-scotty-benchmark
Upgrade code to scotty 0.11.0 and spock 0.12.0.0
- 主要語言
- Haskell
- 星號
- 10
- 分支
- 2
- PR 合併指標
- 30 天內沒有已合併 PR
描述
I was trying to upgrade the code to the latest versions of this framework. I made some modifications the code compiles but `./bench.sh` gives `Invalid http://localhost:8080/echo/plain/hello repsonse! Expected 'hello' got '' (Is the server running?)`
```haskell
{-# LANGUAGE OverloadedStrings #-}
module Main where
import System.Environment
import qualified Web.Scotty as Scotty
import qualified Web.Spock as Spock
import qualified Web.Spock.Config as SpockConfig
main =
do args <- getArgs
let port = 8080
case args of
["scotty"] ->
Scotty.scotty port $
do Scotty.get "/echo/hello-world" $
Scotty.text "Hello World"
Scotty.get "/echo/plain/:param" $
do p <- Scotty.param "param"
Scotty.text p
Scotty.get (Scotty.regex "^/echo/regex/([0-9]+)$") $
do p <- Scotty.param "1"
Scotty.text p
["spock"] -> do
spockCfg <- SpockConfig.defaultSpockCfg () SpockConfig.PCNoDatabase ()
Spock.runSpock port $ Spock.spock spockCfg $
do Spock.get "/echo/hello-world" $
Spock.text "Hello World"
Spock.get "/echo/plain/:param" $
do Just p <- Spock.param "param"
Spock.text p
Spock.get "/echo/regex/{param:^[0-9]+$}" $
do Just p <- Spock.param "param"
Spock.text p
_ -> putStrLn "Usage: ./Spock-scotty-benchmark spock|scotty"
```
貢獻指南
這個儲存庫沒有索引到貢獻指南
評估
這個 Issue 還沒有評估資料。