From abaff62eb730ce9cccacb9f5c3a50e22c3f36247 Mon Sep 17 00:00:00 2001 From: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Date: Sat, 11 Jun 2022 17:56:56 +0100 Subject: [PATCH] Minor readme update --- docs/Requests.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/Requests.md b/docs/Requests.md index 4ad106d..feeb44b 100644 --- a/docs/Requests.md +++ b/docs/Requests.md @@ -14,10 +14,10 @@ This section describes how to work with requests bodys. For information about ro ```purescript router { route: Home, method: Post, body } = usingCont do - jsonRequest :: MyRequest <- fromJson Argonaut.jsonDecoder body - input :: MyValidatedInput <- fromValidated validateMyRequest jsonRequest - output :: MyOutput <- lift $ doSomethingAndReturnAff input - ok' jsonHeaders $ toJson Argonaut.jsonEncoder output + jsonRequest :: MyRequest <- fromJson Argonaut.jsonDecoder body -- parse the json input + input :: MyValidatedInput <- fromValidated validateMyRequest jsonRequest -- validate the input data + output :: MyOutput <- lift $ doSomethingAndReturnAff input -- do your business logic + ok' jsonHeaders $ toJson Argonaut.jsonEncoder output -- return output as json ``` ## Introduction