Skip to content

Commit

Permalink
Fix docs for post-serve-action
Browse files Browse the repository at this point in the history
  • Loading branch information
tommysitu committed Sep 12, 2023
1 parent f4a51ce commit ab7d4f8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions docs/pages/keyconcepts/keyconcepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Hoverfly's functionality is quite broad. You are encouraged to take the time to
state/state
destinationfiltering
middleware
postserveaction
hoverctl

.. raw:: html
Expand Down
8 changes: 4 additions & 4 deletions docs/pages/keyconcepts/postserveaction.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _post_serve_action:

PostServeAction
===============
Post Serve Action
=================

Overview
========
Expand All @@ -14,8 +14,8 @@ Overview

- In order to register post serve action, it takes mainly four parameters - binary to invoke script, script content/location, delay(in ms) post which it will be executed and name of that action.

Ways to register PostServeAction
================================
Ways to register a Post Serve Action
==================================

- At time of startup by passing single/multiple -post-serve-action flag(s) as mentioned in the `hoverfly command page <https://docs.hoverfly.io/en/latest/pages/reference/hoverfly/hoverflycommands.html>`_.

Expand Down
3 changes: 2 additions & 1 deletion docs/pages/tutorials/basic/basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ Basic tutorials
asawebserver/asawebserver
cors/enablecors
specificurls/specificurls
capturingsequences/capturingsequences
capturingsequences/capturingsequences
postserveaction/postserveaction
11 changes: 7 additions & 4 deletions docs/pages/tutorials/basic/postserveaction/postserveaction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Start Hoverfly and register a post serve action:
Once the post serve action is registered, you can confirm using below hoverctl command.

.. code::bash
.. code:: bash
hoverctl post-serve-action get-all
Expand All @@ -47,7 +47,8 @@ Once the post serve action is registered, you can confirm using below hoverctl c
Copy this simulation JSON content to a file called ``simulation.json``:

.. code::json
.. code:: json
{
"data": {
"pairs": [
Expand Down Expand Up @@ -104,17 +105,19 @@ Copy this simulation JSON content to a file called ``simulation.json``:
Run this hoverctl command to import the simulation file.
.. code:: bash
hoverctl import <path-to-simulation-file>
The simulation sets hoverfly to return a successful response and 3 seconds after that invokes the "callback-script" action.
You can try it out by making the following request to http://date.jsontest.com using cURL.

.. code::bash
.. code:: bash
curl --proxy http://localhost:8500 http://date.jsontest.com
You should see the message in the hoverfly logs - `Output from post serve action HTTP call invoked from IP Address`.

.. code::bash
.. code:: bash
hoverctl logs
Expand Down

0 comments on commit ab7d4f8

Please sign in to comment.