apiary-0.5.1.0: Simple web framework inspired by scotty.

Safe HaskellNone

Control.Monad.Apiary.Action

Contents

Synopsis

Documentation

data ApiaryConfig Source

Constructors

ApiaryConfig 

Fields

notFound :: Application

call when no handler matched.

defaultStatus :: Status

used unless call status function.

defaultHeader :: ResponseHeaders

initial headers.

rootPattern :: [ByteString]

used by root filter.

mimeType :: FilePath -> ByteString
 

actions

stop :: Monad m => ActionT m aSource

stop handler and send current state. since 0.3.3.0.

stopWith :: Monad m => Response -> ActionT m aSource

stop with response. since 0.4.2.0.

getter

getQuery :: Monad m => ByteString -> ActionT m (Maybe (Maybe ByteString))Source

Deprecated: use qeury derived filter.

getQuery' :: Monad m => ByteString -> ActionT m (Maybe ByteString)Source

Deprecated: use qeury derived filter.

when query parameter is not found, mzero(pass next handler).

getRequestHeader' :: Monad m => HeaderName -> ActionT m ByteStringSource

when request header is not found, mzero(pass next handler).

setter

response header

response body

file :: Monad m => FilePath -> Maybe FilePart -> ActionT m ()Source

set body to file content and detect Content-Type by extension.

monolithic action

redirect

redirectSource

Arguments

:: Monad m 
=> Status 
-> ByteString

Location redirect to

-> ActionT m a 

redirect handler

set status, location header and stop. since 0.3.3.0.

redirectPermanently :: Monad m => ByteString -> ActionT m aSource

redirect with 301 Moved Permanently. since 0.3.3.0.

redirectFound :: Monad m => ByteString -> ActionT m aSource

redirect with 302 Found. since 0.3.3.0.

redirectSeeOther :: Monad m => ByteString -> ActionT m aSource

redirect with 303 See Other. since 0.3.3.0.

redirectTemporary :: Monad m => ByteString -> ActionT m aSource

redirect with 307 Temporary Redirect. since 0.3.3.0.

Reexport