agrafix / agrafix/Spock-scotty-benchmark

Upgrade code to scotty 0.11.0 and spock 0.12.0.0

Ouverte
#5 4 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Haskell
Étoiles
10
Forks
2
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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"
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.