Skip to content

Instantly share code, notes, and snippets.

@prasmussen
Created May 23, 2014 22:35
Show Gist options
  • Save prasmussen/4b0d8f78b156d2ceaccf to your computer and use it in GitHub Desktop.
Save prasmussen/4b0d8f78b156d2ceaccf to your computer and use it in GitHub Desktop.
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