Created
May 23, 2014 22:35
-
-
Save prasmussen/4b0d8f78b156d2ceaccf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postApiR :: Handler () | |
postApiR = do | |
liftIO $ putStrLn "init" | |
payload <- requireJsonBody :: Handler Payload | |
now <- liftIO getCurrentTime | |
_ <- runDB $ insert $ Weather now (temperature payload) (humidity payload) | |
sendResponseStatus status201 ("CREATED" :: Text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment