servant icon indicating copy to clipboard operation
servant copied to clipboard

RawM cookbook and changelog entry

Open tchoutri opened this issue 2 years ago • 4 comments

A cookbook and changelog entry must be written for the RawM combinator.

tchoutri avatar Feb 26 '23 13:02 tchoutri

Sure, as a follow-up to #1551, since I am sure others will like to use it too.

mgajda avatar Feb 26 '23 17:02 mgajda

Are there any usage examples anywhere for RawM? I'm trying to port from servant-rawm to current servant and am stuck.

goertzenator avatar Mar 19 '24 17:03 goertzenator

@hasufell did you use this combinator in the end?

tchoutri avatar Mar 19 '24 21:03 tchoutri

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

goertzenator avatar Mar 19 '24 22:03 goertzenator