servant
servant copied to clipboard
RawM cookbook and changelog entry
A cookbook and changelog entry must be written for the RawM combinator.
Sure, as a follow-up to #1551, since I am sure others will like to use it too.
Are there any usage examples anywhere for RawM? I'm trying to port from servant-rawm to current servant and am stuck.
@hasufell did you use this combinator in the end?
I figured it out in the end. servant-rawm had a bunch of file server functions that worked directly with RawM so I had to do some digging to find alterantives.
rawmSample :: Request -> (Response -> IO ResponseReceived) -> AppM ResponseReceived
rawmSample req resp = do
path <- asks files_path
let settings = defaultWebAppSettings path
liftIO $ staticApp settings req resp