Quickstart

Overview

To get started quickly with Hoverfly Cloud, it helps to understand these three main concepts.

A simulation

Hoverfly Cloud API simulations work by matching incoming HTTP requests to stored HTTP responses. A simulation is a JSON file that contains information about the HTTP requests which will be received, the responses which will be returned, and the logic that determines which requests will be matched to which responses.

An instance

A unit of CPU and memory capacity within Hoverfly Cloud which serves a simulation. A simulation can run on one instance, or on a cluster of instances. This makes it possible to start high-performance simulations for load testing.

Simulations and instances

The Hoverfly Cloud Agent

A command line tool which can be used to:

Hoverfly Cloud Agent

The Hoverfly Cloud agent requires an API token to authenticate with Hoverfly Cloud. It can be installed on development machines or continuous integration servers.

First steps

Start an example instance

Your new account is pre-loaded with an example simulation file.

On the Instances page, click the “Start” button.

Start an instance

Leave “Target URL” input blank to start a simulate-only instance.

Name your instance my-test-instance.

Select the example simulation from the drop down and click “Confirm”.

When status of your instance is changed to RUNNING, it is ready to use.

Create an API token

Hoverfly Cloud instance is secured by API token. You can create one from the Account page.

Generate API token

On your local machine, store the token in an environment variable:

export HFC_TOKEN=<my-token>
setx HFC_TOKEN <my-token>

Make requests to the instance

From the Account page, download and extract the agent to a location on your PATH.

Download agent

Start a local reverse proxy that points to the simulation instance:

hoverfly-cloud-agent start-reverse-proxy \
                     --name my-test-instance \
                     --api-token $HFC_TOKEN
hoverfly-cloud-agent start-reverse-proxy \
                     --name my-test-instance \
                     --api-token %HFC_TOKEN%

Point your browser at http://localhost:8500, or make a request using cURL:

curl http://localhost:8500
Example simulation

The response was returned by the simulation.

Stop the reverse proxy:

hoverfly-cloud-agent stop-reverse-proxy