Hoverfly Cloud
Visit Our Main SitePricingTry Hoverfly Cloud
  • Introduction
  • Use cases for API Simulation
  • Key concepts
  • What's New
  • Dashboard
  • Simulation
    • Create simulations
    • Configuring Request Matchers
      • JSON Request Matchers on the Body
        • EXACT Matcher
        • JSON Matcher
        • JSON Partial Matcher
        • JSONPath Matcher
        • Regular Expression Matcher
      • Handling the response when Hoverfly cannot match
    • Building a JSON Response
      • Using a JSON object from the Request
      • Looping over a JSON array from the Request
    • Simulating Webhooks and Callbacks
    • Using templating in simulations
      • Render back any part of the Request
      • Render synthetic data
      • Faker functions
      • Render dates and times with offsets
      • Conditional logic
      • Looping over arrays
      • Variables and Arrays
      • Arithmetic operations
      • String operations
      • Validation operations
      • Simulating a persistent backend
      • Transitioning state between requests
      • Combining and nesting templating functions
      • Useful helper functions
      • Avoiding HTML encoding in function return values
    • Using data sources in simulations
      • Querying data sources
      • Updating data in data sources
      • Deleting data from data sources
      • Inserting data into a data source
      • Guidance on using the SQL like syntax
    • Working with Simulation Files
  • Service
    • Start a new service
    • Use a service
    • Update a service
    • Configuring Journal Indexing
  • Command line interface
    • Hoverfly Cloud CLI commands
  • Tutorials
    • Quickstart
    • Creating simulations and services
      • Tutorial 1: Create a service and simulation manually
      • Tutorial 2: Create a service and simulation by importing from a Swagger specification
      • Tutorial 3: Create a service and simulation by capturing real API traffic
    • Response Templating
      • Tutorial 4: Response Templating
    • Hoverfly service modes
      • Tutorial 5: Simulate, Capture, Spy and Passthrough modes
    • Automating with the CLI and API
      • Tutorial 6: Using the CLI and the Hoverfly Cloud API
Powered by GitBook
On this page
  1. Tutorials

Quickstart

Quickstart guide for Hoverfly Cloud. Learn how to quickly set up and start using Hoverfly Cloud for API simulation and testing.

PreviousHoverfly Cloud CLI commandsNextCreating simulations and services

Last updated 1 month ago

Start a virtual service from an example simulation

You can start your first virtual service with a pre-loaded by following these steps:

  1. On your , click the "Add" button. An "Add service" dialog box will pop up.

  2. Enter a service name, for example my-test-service.

  3. Select example-simulation from the drop down and click "Confirm".

Hoverfly Cloud provisions a dedicated Hoverfly container and assigns a DNS name for your service (in the form of <service-name>-<id>.hoverfly.io). The service is ready to use when the green tick-mark appears next to the service in the dashboard.

Click on the allocated URL, and you should see the following screen.

Congratulations! You have now got a highly configurable virtual service that you can share and use wherever you want.

If you open the example-simulation by clicking on the simulation "example-simulation", you can then edit the endpoints to make the API simulation do whatever you please.

  1. From within the simulation editor, click Add endpoint, and then change the new endpoint to respond to Get methods.

  2. Add a Path Request matcher, so that this endpoint will respond to a path of /myapi/* using a Glob match - which is a wildcard. So any path that starts with /myapi/ will match.

  3. Add a response body of Hello {{ Request.Path.[1] }}

  4. Make sure to click Enable templating. This will allow Hoverfly to process the commands in the {{ handlebar }} syntax.

  5. Your simulation should be configured as in the image below. Click Apply changes, and you will be returned to the Dashboard.

  6. Now go back to the allocated URL, and add a path of /myapi/<your-name-here>

  7. You should get a greeting from your API

If you look at the , you will see that the test service is running and using the example simulation:

Dashboard
example simulation file
Dashboard
Add a custom endpoint and request matcher