Servant APIs written in any MonadUnliftIO m
can be converted to wai
Application
s without writing the natural transformation by
hand. These functions will return m Application
which means that either:
- You will have to serve from inside your
MonadUnliftIO m
monad, or - You will have to unwrap your application monad to
IO
, bind theApplication
, and then serve it inIO
.
If you choose the second option, beware ResourceT
--- trying to use
the returned Application
outside of a containing ResourceT
risks
attempting to interact with closed resources.