Hacker News new | ask | show | jobs
by 15155 4002 days ago
I'd like to see something like this, but with JSON-based APIs instead of HTML templating.
6 comments

(Author here) There is a set of exercises that come with the slides at https://github.com/serras/lambdaconf-2015-web In particular, they introduce the Aeson library for both producing and consuming JSON.
You should check out PostgREST, a tool to expose Postres tables through a JSON APIs: https://github.com/begriffs/postgrest
I believe the HTML templating stuff is pretty optional in all the major Haskell web platforms. I know in Yesod it is trivial to serve JSON rather than HTML from an end-point, and pretty easy to serve multiple representations of the same resource.
"aeson" is the go-to library for producing and parsing JSON in Haskell.
thoughtbot's carnival is a good example of a JSON API written with Yesod: https://github.com/thoughtbot/carnival