Closed craff closed 1 year ago
You're not missing anything, this is really just the httpd part. I think it'd be interesting, maybe, to build a higher-level library on top of it to handle sessions, etc. but this might be scope creep (for a realistic full website you might be better using Dream directly). If you write API endpoints, otoh, this should be enough with maybe a thin session layer, but no multipart?
I saw you are preparing a release ... I have some code both for parsing multipart post request and for session. Both are very light I think and would fit at this level of the library.
I could move the first code in Util where there is already a parser for GET request and add my code for session in a new module. But both needs some work.
Would you like me to submit pull request before or after the release ?
It's already released, look on opam :).
tiny_httpd.multipart
? or maybe a kind of small framework on top of tiny http, with sessions, etc.)The code is rather small and now in Tiny_httpd_util where there is parse_query. I push a PR, you will see, I actually cleaned the code and mover it in Tiny_httpd on my fork.
I used Str, via a thread safe interface (using mutex). It is much easier that way.
It would be better to use a real regexp library or maybe use pacomb for that. But I feel you want (and I wand) minimum dependency beside Ocaml Stdlib's
For session. I am not sure what to do exactly. May be just function for cookies, and let the user manage session. That could be very simple.
PR #38 should be enough for now
You may close this too.
Two features which are almost always needed are not provided: