Minor readme update
This commit is contained in:
parent
280b2c4eb0
commit
abaff62eb7
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user