Skip to Content
UsageMock Servers

Mock Servers

Astraio allows you to create mock servers for testing without a real backend.

Creating a Mock

  1. Open Settings > Mocks
  2. Click + New Mock
  3. Configure the mock:
    • Name: Descriptive name
    • Port: Local port (e.g., 3001)
    • Base Path: Optional prefix (e.g., /api/v1)

Adding Endpoints

  1. Open your mock
  2. Click + Add Endpoint
  3. Configure:
    • Method: GET, POST, etc.
    • Path: /users/:id
    • Status: 200, 404, etc.
    • Response Body: JSON or text
    • Headers: Custom response headers
    • Delay: Simulate latency (ms)

Path Parameters

Use :param syntax for dynamic segments:

/users/:id/posts/:postId

Access in response:

{ "user_id": "{{id}}", "post_id": "{{postId}}" }

Starting a Mock

  1. Select your mock
  2. Click Start
  3. The mock is now listening on the configured port
  4. Send requests to http://localhost:<port>

Use Cases

  • Frontend development — Mock APIs before backend is ready
  • Testing — Simulate error responses
  • Prototyping — Quickly test API designs
  • Demo — Share mock endpoints with team
Last updated on