We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello! I really think what you are doing here is grand! I am in the mutable state area
counterHandler :: Int -> Server.Request -> (Int, Server.Response) counterHandler currentCount = (newCount, response) where newCount = currentCount + 1 response = Server.simpleHandler ("Current count: " ++ show newCount)
Where the counterHandler is, I think you wanted to use Server.stringResponse? Also you only have the currentCount, and not the req as a parameter
Only want to help, so if I am stupid just tell me to shut up! :)
The text was updated successfully, but these errors were encountered:
main :: IO () main = Server.startServer [ Server.handlersWithState initialState [counterHandler] ]
I made this work with: Server.handlersWithState initialState [Server.statefulHandler Server.GET "/count" counterHandler]
Sorry, something went wrong.
2265325
You're absolutely right, thanks for spotting this! :)
No branches or pull requests
Hello! I really think what you are doing here is grand!
I am in the mutable state area
counterHandler :: Int -> Server.Request -> (Int, Server.Response)
counterHandler currentCount
= (newCount, response)
where
newCount
= currentCount + 1
response
= Server.simpleHandler ("Current count: " ++ show newCount)
Where the counterHandler is, I think you wanted to use Server.stringResponse?
Also you only have the currentCount, and not the req as a parameter
Only want to help, so if I am stupid just tell me to shut up! :)
The text was updated successfully, but these errors were encountered: