Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RawM cookbook and changelog entry #1651

Open
tchoutri opened this issue Feb 26, 2023 · 4 comments
Open

RawM cookbook and changelog entry #1651

tchoutri opened this issue Feb 26, 2023 · 4 comments

Comments

@tchoutri
Copy link
Contributor

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

@mgajda
Copy link

mgajda commented Feb 26, 2023

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

@goertzenator
Copy link

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

@tchoutri
Copy link
Contributor Author

@hasufell did you use this combinator in the end?

@goertzenator
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants