Some debugging stuff

This commit is contained in:
Paul Chiusano 2015-02-10 20:44:23 -05:00
parent 8fd0495596
commit 8e02186a08
2 changed files with 6 additions and 2 deletions

View File

@ -9,7 +9,7 @@ import Set as S
type alias Encoder a = a -> J.Value
render : Encoder a -> a -> String
render ja a = J.encode 2 (ja a)
render ja a = J.encode 0 (ja a)
contramap : (a -> b) -> Encoder b -> Encoder a
contramap f j = j << f

View File

@ -52,7 +52,11 @@ originOptions = do
S.addHeader "Access-Control-Allow-Headers" "Content-Type"
route :: ActionM () -> ActionM ()
route action = originPolicy *> action
route action = do
originPolicy
body <- S.body
liftIO (putStrLn ("request body\n" ++ show body))
action
server :: Int -> Node IO Reference T.Type E.Term -> IO ()
server port node = S.scotty port $ do