Mock APIs with Map Local

Map Local basics: your first mock

Answer a URL with your own response, without touching the server.

Map Local answers a request with a response you define. The real server is not called. Use it to build a screen before the API exists, test error states, or freeze data for a demo.

Create your first rule

  1. Open Map Local in AegisCeptor.
  2. Click + New.
  3. Fill in the rule:
    URL pattern
    example.com/api/me
    Method
    GET (leave empty for any method)
    Status code
    200
    Content-Type
    application/json; charset=utf-8
  4. Paste a response body:
    {
      "id": "u_1001",
      "name": "Demo User",
      "email": "demo@example.com",
      "plan": "pro"
    }
  5. Open https://example.com/api/me in a captured browser. You get your JSON, and the request is marked as mocked in the traffic list.

Rules apply within about a second; you do not need to restart anything.

URL patterns

PatternMatchesDoes not match
example.com/api/productsthat path, with any query: /api/products?page=2/api/products/42
example.com/api/products?page=2only that exact query?page=3
example.com/api/banners/*anything under it: /api/banners/home/api/banner
*.example.com/api/*any subdomainother domains
example.com/api/products/:id/api/products/42, with id = 42/api/products/42/reviews
/api/products/:idthe same path on any host
/\/api\/v\d+\/me/a regular expression (between slashes)
productsany URL that contains the text

Matching ignores upper and lower case. https:// is optional. When two rules match, an exact match wins over a host/path rule that only matched because the query was ignored.

Other fields

Delay (ms)
Wait before answering, for example 3000 to test loading states.
Headers
Extra response headers, one Name: value per line.
Local file
Serve a file from your Mac instead of the body, for example a large JSON or an image. See Files and sharing.
Folder
Group rules by feature or project. Toggle a whole folder on or off at once, and export it to share.
Good to know: mocked responses include Cache-Control: no-store so the browser does not cache them, and the right CORS headers so web apps on another origin can read them.

Next