Quick start

Create an HTTP simulator, send a request, add a dynamic response and test a failure.

On this page

This quick start uses the HTTP API simulator because it needs nothing else: no database, no AWS account. You'll need FlowReactor installed and activated, and curl or any HTTP client.

1. Add an HTTP API

  1. In the sidebar, next to Services, choose + Add.
  2. Choose HTTP API, keep the port 18080, and choose Add HTTP simulator.
  3. Choose Start.

2. Call it

bash
curl http://127.0.0.1:18080/health

You get {"status": "ok"} from the example route, and the request appears on the service's Activity tab with its status and timing.

The HTTP Api Activity tab showing a responseThe HTTP Api Activity tab showing a response
Activity tab shows history and details.

3. Add your own route

  1. Open the Routes tab and choose Add route › Blank route.

  2. Set the method to GET and the path to /users/{id}.

  3. Set the body to:

    json
    { "id": "{{path.id}}", "name": "{{fake.name}}", "email": "{{fake.email}}" }
    
  4. Choose Save routes. The change applies immediately; no restart.

bash
curl http://127.0.0.1:18080/users/42

Every call returns user 42 with a new fake name and email. See response templates for every value you can use.

4. Return a controlled failure

  1. Click the dot next to the /users/{id} route. It turns into a breakpoint.
  2. Run the curl command again. It waits: the request is paused, and Paused now appears at the top of the timeline.
  3. Choose the paused request, then Return status… › 503.

curl gets 503 Service Unavailable. Use this to check your application's error handling without changing the real API. Click the dot again to turn the breakpoint off.

Next