Wheb-Framework icon indicating copy to clipboard operation
Wheb-Framework copied to clipboard

RouteParamDoesNotExist following example in readme

Open khanage opened this issue 11 years ago • 0 comments

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.

khanage avatar Nov 03 '14 08:11 khanage