Update image links

finishes #64
This commit is contained in:
Tom Pytleski
2018-01-25 12:04:34 -06:00
parent cc2a0e8dbb
commit 44a85d9cc5
7 changed files with 6 additions and 6 deletions

View File

@@ -15,7 +15,7 @@ _Note: We plan to introduce templates to the Stoplight editor file creation proc
1. Create a **new Stoplight project**.
2. Inside of your new project, create a **OAS (Swagger 2) modeling file**. Let's name it `hello.oas2`. You can learn more about our visual OAS editor here.
![](//s3.amazonaws.com/hifs/mock/hello.oas2.gif)
![](../../assets/gifs/mock-hello-oas2.gif)
3. Add a `GET /hello` operation to your new OAS specification.
4. Add a **200 response** to the operation, with the example JSON described below. **Save** the OAS file.
@@ -26,22 +26,22 @@ _Note: We plan to introduce templates to the Stoplight editor file creation proc
}
```
![](//s3.amazonaws.com/hifs/mock/get.hello.200.gif)
![](../../assets/gifs/mock-get-hello-200.gif)
5. Create a new **Prism instance file** in the project. Name it `hello-mock.prism`.
6. Prism instances are made up of APIs and Rules, you can learn more about them here. Add an API to the Prism instance, and connect the `hello.oas2` specification that you created earlier.
![](//s3.amazonaws.com/hifs/mock/hello.prism.api.gif)
![](../../assets/gifs/mock-hello-prism-api.gif)
7. Next, add a **new rule** that you will setup to power the mocking. Rules simply apply scenarios to HTTP traffic passing through the Prism instance.
8. Once you have created a new rule, you need to connect it to the API we added earlier. To do that, click on the `apis` dropdown input, and select the previously created API.
9. Finally, you need to add a **scenario** that will actually perform the mocking. We have an official Stoplight mock scenario [here](https://next.stoplight.io/stoplight/prism?edit=%23%2Fscenarios%2Fmock), which makes it easy to get started. Add a scenario to the `before` section of your rule. Select `another project` in the first dropdown, and then search for `prism`. The file in that project you are looking for is `helpers.prism.yml`, and the specific scenario is called `mock`. This mock scenario should suit most of your mocking use cases. For advanced use cases please send us a message and we would love to help out.
![](//s3.amazonaws.com/hifs/mock/hello.prism.rule.gif)
![](../../assets/gifs/mock-hello-prism-rule.gif)
8. **Save** your Prism instance. To verify that your mock server is working, click on the `Home` link at the top of the prism instance sidebar, and then send a test request to `GET /hello`. You should see a 200 response that equals the example you set in your OAS file earlier!
![](//s3.amazonaws.com/hifs/mock/hello.prism.gif)
![](../../assets/gifs/mock-hello-prism.gif)
# Running Your Prism Server Locally
@@ -54,7 +54,7 @@ In the previous section, you learned how to create a simple Prism instance that
3. Get the export link for the prism mock instance you created above.
4. Run `prism serve {export-link} --debug` and open this [link](http://localhost:4010/helloWorld).
![](//s3.amazonaws.com/hifs/mock/hello.prism.local.gif)
![](../../assets/gifs/mock-hello-prism-local.gif)
# Recap

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 MiB