mig-wai-0.1.1.0: Render mig-servers as wai-applications
Safe HaskellSafe-Inferred
LanguageGHC2021

Mig.Server.Wai

Description

Converts mig server to WAI-application.

Synopsis

Documentation

data ServerConfig Source #

Server config

Constructors

ServerConfig 

Fields

Instances

Instances details
Default ServerConfig Source # 
Instance details

Defined in Mig.Server.Wai

Methods

def :: ServerConfig #

data FindRouteType Source #

Algorithm to find route handlers by path

Constructors

TreeFinder

converts api to tree-like structure (prefer it for servers with many routes)

PlainFinder

no optimization (prefer it for small servers)

type Kilobytes = Int Source #

Size of the input body

toApplication :: ServerConfig -> Server IO -> Application Source #

Converts mig server to WAI-application. Note that only IO-based servers are supported. To use custom monad we can use hoistServer function which renders monad to IO based or the class HasServer which defines such transformatio for several useful cases.