diff --git a/src/pages/index.astro b/src/pages/index.astro index be517ab..8b00997 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -49,12 +49,17 @@ import Layout from '../layouts/Layout.astro'; terminal -
-

$ devproxy

-

Listening on 127.0.0.1:8000...

-

200 GET https://api.contoso.com/users

-

429 GET https://api.contoso.com/data ← throttled

-

500 POST https://api.contoso.com/items ← server error

+
+

devproxy

+

  info    Dev Proxy listening on 127.0.0.1:8000...

+

+

  req    GET https://api.contoso.com/posts

+

  skip   GenericRandomErrorPlugin: Pass through

+

  pass   Passed through

+

+

  req    GET https://api.contoso.com/posts

+

  skip   RetryAfterPlugin: Request not throttled

+

  oops   GenericRandomErrorPlugin: 429 429

@@ -78,116 +83,109 @@ import Layout from '../layouts/Layout.astro';
- +
-

Resilience Testing

-

See how your app handles API errors.

+

API Mocking

+

Mock APIs that don't exist yet.

- Simulate random errors, timeouts, and failures for any API — without touching your code. Build more robust apps and never lose your customers' data. + Stand up a fully-functional CRUD API without writing a single line of server code. Design, prototype, and build your frontend in parallel with your backend.

- + Learn more →
-

// Your app makes a normal API call

-

fetch('https://api.contoso.com/orders')

-

// Dev Proxy intercepts and returns

-

500 Internal Server Error

-

429 Too Many Requests

-

503 Service Unavailable

-

// Does your app handle it?

+

// customers-api.json — CrudApiPlugin

+

"baseUrl": "https://api.contoso.com/customers"

+

getAll GET    /customers

+

getOne GET    /customers/{id}

+

create POST   /customers

+

merge  PATCH  /customers/{id}

+

delete DELETE /customers/{id}

+

// Defined in JSON. Zero server code.

- +
-

Rate Limit Simulation

-

Verify your app respects API limits.

+

Resilience Testing

+

See how your app handles API errors.

- Simulate rate limiting and throttling responses before they happen in production. Avoid getting blocked and deliver a smoother experience for your users. + Simulate random errors, timeouts, and failures for any API — without touching your code. Build more robust apps and never lose your customers' data.

- + Learn more →
-
-
-
- Request 1 - 200 OK -
-
- Request 2 - 200 OK -
-
- Request 3 - 200 OK -
-
-
- Request 4 - 429 Throttled -
-
- Request 5 - 429 Throttled -
-

Retry-After: 30s

-
+
+

// errors-contoso-api.json

+

"url": "https://api.contoso.com/*"

+

"responses":

+

  500 Internal Server Error

+

  429 Too Many Requests

+

  503 Service Unavailable

+

// Random errors at configured failure rate.

- +
-

API Mocking

-

Mock APIs that don't exist yet.

+

AI / LLM Testing

+

Build & test AI apps without burning tokens.

- Stand up a fully-functional CRUD API without writing a single line of server code. Design, prototype, and build your frontend in parallel with your backend. + Route OpenAI and Azure OpenAI API calls to a local language model during development. Get real responses while building your AI-powered apps — without spending tokens.

- + Learn more →
-

// No backend? No problem.

-

GET /products → list

-

POST /products → create

-

PUT /products/:id → update

-

DEL /products/:id → delete

-

// Zero lines of server code.

+

// Your app calls OpenAI

+

POST /v1/chat/completions

+

// Dev Proxy routes to local LLM

+

Ollama (llama3.2)

+

200 { "choices": [{ "message": ... }] }

+

// Real responses. Zero API costs.

- +
-

Latency Simulation

-

Test what happens when APIs are slow.

+

Rate Limit Simulation

+

Verify your app respects API limits.

- Add realistic latency to any API response. Make sure your loading states, timeouts, and cancellation logic work as expected. + Simulate rate limiting and throttling responses before they happen in production. Avoid getting blocked and deliver a smoother experience for your users.

- + Learn more →
-
- @@ -199,17 +197,19 @@ import Layout from '../layouts/Layout.astro';

Run Dev Proxy as part of your CI/CD pipeline to catch API integration issues before they reach production. Works with GitHub Actions, Azure DevOps, and more.

- + Learn more →

# .github/workflows/test.yml

steps:

-

- name: Install Dev Proxy

-

run: bash install.sh

-

- name: Run tests with proxy

-

run: devproxy & npm test

+

- name: Setup Dev Proxy

+

uses: dev-proxy-tools/actions/setup@v1

+

- name: Run tests

+

run: npm test

+

- name: Stop Dev Proxy

+

uses: dev-proxy-tools/actions/stop@v1

✓ 42 passed, 0 failed

@@ -254,12 +254,12 @@ import Layout from '../layouts/Layout.astro';
{[ - { title: 'Test my app handles API errors', time: '5 min', href: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/how-to/test-my-app-with-random-errors' }, { title: 'Mock an API that doesn\'t exist yet', time: '10 min', href: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/how-to/simulate-crud-api' }, - { title: 'Check my Microsoft Graph permissions', time: '10 min', href: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/how-to/check-minimal-api-permissions' }, + { title: 'Test my app handles API errors', time: '5 min', href: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/how-to/test-my-app-with-random-errors' }, + { title: 'Simulate OpenAI with a local LLM', time: '15 min', href: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/how-to/simulate-openai' }, + { title: 'Simulate rate limiting responses', time: '10 min', href: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/how-to/simulate-rate-limit-api-responses' }, + { title: 'Automate API testing in CI/CD', time: '15 min', href: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/how-to/use-dev-proxy-with-github-actions' }, { title: 'Discover what APIs my app calls', time: '5 min', href: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/how-to/discover-urls-to-watch' }, - { title: 'Automate API testing in CI/CD', time: '15 min', href: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/how-to/use-dev-proxy-in-ci-cd-overview' }, - { title: 'Simulate LLM API failures', time: '10 min', href: 'https://learn.microsoft.com/microsoft-cloud/dev/dev-proxy/how-to/simulate-errors-from-language-model-apis' }, ].map((scenario) => (