servant-scotty-0.1.1: Generate a web service for servant 'Resource's using scotty and JSON

Stabilityexperimental
MaintainerAlp Mestanogullari <alp@zalora.com>
Safe HaskellNone

Servant.Scotty.Response

Contents

Description

This module exports the Response class and a handy respond function that you can use when defining handlers for your own operations.

Synopsis

The Response class

respond

respond :: (Response resp x, ScottyError e, Monad m) => x -> ActionT e m ()Source

Given the result of some operation, it picks the appropriate response type and uses toResponse to convert the result to a JSON-encodable value along with a status code, both used to then send a response to the client.