'Scotty Haskell Web server doesnt response
I have following code:
S.post "/newPost" $ do
name <- S.param "name"
content <- S.param "content"
liftIO $ D.newPost name content
liftIO $ putStrLn "it works"
So, the last line will never be reached.
The newPost method looks like:
newPost :: T.Text -> T.Text -> IO ()
newPost name content = do
c <- conn
stmt <- prepareStmt c "INSERT INTO post (name, content) VALUES (?, ?)"
queryStmt c stmt [MySQLText name, MySQLText content]
close c
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|