Minor readme update

This commit is contained in:
sigma-andex 2022-06-11 17:56:56 +01:00
parent 280b2c4eb0
commit abaff62eb7
No known key found for this signature in database
GPG Key ID: C5F79968835855AB

View File

@ -14,10 +14,10 @@ This section describes how to work with requests bodys. For information about ro
```purescript ```purescript
router { route: Home, method: Post, body } = usingCont do router { route: Home, method: Post, body } = usingCont do
jsonRequest :: MyRequest <- fromJson Argonaut.jsonDecoder body jsonRequest :: MyRequest <- fromJson Argonaut.jsonDecoder body -- parse the json input
input :: MyValidatedInput <- fromValidated validateMyRequest jsonRequest input :: MyValidatedInput <- fromValidated validateMyRequest jsonRequest -- validate the input data
output :: MyOutput <- lift $ doSomethingAndReturnAff input output :: MyOutput <- lift $ doSomethingAndReturnAff input -- do your business logic
ok' jsonHeaders $ toJson Argonaut.jsonEncoder output ok' jsonHeaders $ toJson Argonaut.jsonEncoder output -- return output as json
``` ```
## Introduction ## Introduction