--
You received this message because you are subscribed to the Google Groups "haskell-servant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-servant+unsubscribe@googlegroups.com.
To post to this group, send email to haskell-servant@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-servant/32834565-980a-459d-864e-02612b8a2f6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
type PaintingAPI = "paintings" :> read_all_json() where read_all_json is a function which make a request to the api and parse it to a [] ? |
I definitely recommend separate functions. I've always had a harder time working on services where the code for the handlers got long and was doing several things, as opposed to hust delegating the few steps to a few well thought out functions.
Le 13 févr. 2017 18:09, "r/ Wobben" <wobb...@gmail.com> a écrit :
--Hello,I'm trying to build a site where the data is pulled out of a external json api.Now I have 1 question.Where do I do the fetching and parsing of the json. In the handler or schould I write seperate functions for it that the handler uses ?Roelof
You received this message because you are subscribed to the Google Groups "haskell-servant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-serva...@googlegroups.com.
To post to this group, send email to haskell...@googlegroups.com.
Alp,Thanks,So something like this :
type PaintingAPI = "paintings" :> read_all_json()where read_all_json is a function which make a request to the api and parse it to a [] ?