Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dongcheng authored Nov 18, 2019
1 parent c351f86 commit e90368c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,10 @@ handle path: '/user/{uid}/get', method: "GET", {
}
}
}
```

And also you can write json response directly

```groovy
handle path: '/user/{uid}/get', method: "GET", {
sleep 100.millisecond
get('/user/{uid}/get2') {
// and also you can write json response directly
resp.eval """{
"id": "${req.pathVariables.uid}",
"name": "${random.forRegex(/[A-Z][a-z]{3,10}/)}",
Expand Down Expand Up @@ -128,6 +123,7 @@ mirage user.mir

```json
$ curl -s http://127.0.0.1:8080/user/1234/get | jq .
$ curl -s http://127.0.0.1:8080/user/1234/get2 | jq .
{
"id": "1234",
"name": "Astn",
Expand Down

0 comments on commit e90368c

Please sign in to comment.