Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I want to serve a JSON response over HTTP, preferably from a standalone server (like django etc). Later I want to talk to Postgres and memcached.

Do I use this thing? http://ocsigen.org/ocsigenserver/ All the docs either don't do what I'm looking for (i.e set up a web server to serve some static files) or are broken links!

OCaml is actually what I'd prefer to use (since I had a blast with SML/NJ)

I'll check out that book, thanks! But I did just skim the ToC and it has nothing about serving HTTP. Serving HTTP is like my #1 use case for anything these days :/



For HTTP I always use 'ocaml-cohttp' (opam install cohttp):

https://github.com/mirage/ocaml-cohttp/blob/master/examples/...

For JSON I normally use 'Jsonm' but I've heard good things about 'Ezjsonm':

https://github.com/samoht/ezjsonm

I've not personally tried them but 'postgresql-ocaml' and 'ocaml-memcached' look plausible.


I think all the pieces are there to do that (e.g. cohttp, yojson, atdgen, PG'OCaml), although perhaps not in a single easy to use framework.

Maybe http://rgrinberg.com/blog/2014/04/04/introducing-opium/ is relevant.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: