From d87dbd1360c14df83552fd757438c23e5d7b9f9c Mon Sep 17 00:00:00 2001 From: Joris Date: Fri, 11 Sep 2015 10:36:27 +0200 Subject: Using jsonObject to create on the fly json object responses --- src/server/Json.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/server/Json.hs (limited to 'src/server/Json.hs') diff --git a/src/server/Json.hs b/src/server/Json.hs new file mode 100644 index 0000000..51287ed --- /dev/null +++ b/src/server/Json.hs @@ -0,0 +1,12 @@ +module Json + ( jsonObject + ) where + +import Web.Scotty (json, ActionM) + +import qualified Data.Aeson.Types as Json +import qualified Data.HashMap.Strict as M +import Data.Text (Text) + +jsonObject :: [(Text, Json.Value)] -> ActionM () +jsonObject = json . Json.Object . M.fromList -- cgit v1.2.3