Wheb-Framework
Wheb-Framework copied to clipboard
RouteParamDoesNotExist following example in readme
I have the following:
{-# LANGUAGE OverloadedStrings #-}
import Web.Wheb
import Data.Monoid ((<>))
handleHome :: MinHandler
handleHome = text $ "Hello, world!"
handleEcho :: MinHandler
handleEcho = do
msg <- getRouteParam "msg"
text $ "Msg was: " <> msg
main :: IO ()
main = do
opts <- genMinOpts $ do
addGET "home" rootPat handleHome
addGET "echo" ("echo" </> (grabText "msg")) handleEcho
runWhebServer opts
But when I access http://localhost:3000/echo/hello I get an error Error: RouteParamDoesNotExist.
Have I done something wrong here? I'm using Wheb 0.3.1.0 from ghc 7.8.3 on osx.