Last active
January 4, 2020 14:59
-
-
Save aronbudinszky/49c3c4086ba19d3534dfee2cab72038c to your computer and use it in GitHub Desktop.
Run prism server.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run the prism server, you can set the port with -p to whatever you want | |
prism mock -p 4010 ~/path/to/your/openapi.yaml | |
# Now you can access the fake API endpoints | |
curl -X GET "http://127.0.0.1:4010/endpoint?parameter=value" -H "accept: application/json" | |
# If you have json_pp installed (available via Homebrew on macOS) you can even nicely format the response | |
curl -X GET "http://127.0.0.1:4010/endpoint?parameter=value" -H "accept: application/json" | json_pp | |
# You can also test specific response codes using the __code query string | |
curl -X GET "http://127.0.0.1:4010/locations?__code=304" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment