reason-native-web / morph

A webframework for Reason and OCaml
https://reason-native-web.github.io/morph/
MIT License
139 stars 7 forks source link

initial commit on static file feature #2

Closed shawn-mcginty closed 5 years ago

shawn-mcginty commented 5 years ago

this hasn't been fully tested yet, but this is my general idea. Using Lwt_stream to handle static files (or really any large amount of data). And helpers for static file and mime types.

shawn-mcginty commented 5 years ago

This is now ready to test, it's working for me.

ulrikstrid commented 5 years ago

I looked a bit at how Cohttp does it and they just handle a Body.t as a binary thing so it can basically be anything and the user has to do the conversion. I think we should do the same but I think this is good to go for now.

Thank you for this!