Skip to content

Commit

Permalink
feat: SL-82 split mock and server commands
Browse files Browse the repository at this point in the history
* feat: SL-82 split mock and server commands

* fi: SL-82 exposed IHttpConfig to createServer util

* fix: SO-82 fixed tests

* fix: SL-82 created common args/flags place for cli

* fix: SL-80 more reasonable examples

* fix: SL-82 examples cleanup
  • Loading branch information
karol-maciaszek committed Apr 10, 2019
1 parent 68025c6 commit 4ba0c28
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ content-length: 98
content-type: application/json

{
"id":-93918115,
"name":"magna",
"tag":"pariatur"
"id": 13137069,
"name": "doggie",
"photoUrls": [ "ad fugiat sunt", "ea" ],
...
}
```

Expand All @@ -72,10 +73,29 @@ Responses will be mocked using realistic data that conforms to the type in the d
This will run a proxy server with validation enabled according to given spec.

```bash
$ prism server examples/petstore.json
$ prism server examples/petstore.oas2.json
> http://127.0.0.1:4010
```

Now let's call our server with a non-existing url to see validation in action:


```bash
$ http GET http://127.0.0.1:4010/petz

HTTP/1.1 500 Internal Server Error
Connection: keep-alive
Date: Wed, 10 Apr 2019 10:18:53 GMT
content-length: 101
content-type: application/json; charset=utf-8

{
"error": "Internal Server Error",
"message": "Route not resolved, none path matched.",
"statusCode": 500
}
```

#### Determine Responses

Prism can be forced to return different HTTP responses by specifying the status code in the query
Expand Down

0 comments on commit 4ba0c28

Please sign in to comment.