@jaredwray/mockhttp 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,7 +35,7 @@
35
35
  </script>
36
36
  <title>MockHTTP - HTTPS and HTTP/2</title>
37
37
  <script type="application/ld+json">
38
- {"@context":"https://schema.org","@type":"TechArticle","headline":"HTTPS and HTTP/2","description":"","url":"https://mockhttp.org/docs/https/","publisher":{"@type":"Organization","name":"MockHTTP"},"dateModified":"2026-09-18","keywords":[]}
38
+ {"@context":"https://schema.org","@type":"TechArticle","headline":"HTTPS and HTTP/2","description":"","url":"https://mockhttp.org/docs/https/","publisher":{"@type":"Organization","name":"MockHTTP"},"dateModified":"2026-10-20","keywords":[]}
39
39
  </script>
40
40
  </head>
41
41
 
@@ -191,7 +191,26 @@
191
191
  <section class="nav-sidebar__section">
192
192
  <ul class="nav-sidebar__list">
193
193
  <li>
194
- <a href="/docs/hosted/" class="nav-sidebar__item">Hosted Service</a>
194
+ <a href="/docs/hosted/" class="nav-sidebar__item">MockHttp.org Live</a>
195
+ </li>
196
+ </ul>
197
+ </section>
198
+ <section class="nav-sidebar__section nav-sidebar__section--collapsible">
199
+ <h2 class="nav-sidebar__title">
200
+ <button type="button" class="nav-sidebar__toggle" aria-expanded="true">
201
+ <span class="nav-sidebar__toggle-label">How to Deploy</span>
202
+ <svg class="nav-sidebar__chevron" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>
203
+ </button>
204
+ </h2>
205
+ <ul class="nav-sidebar__list">
206
+ <li>
207
+ <a href="/docs/how-to-deploy/cloudflare/" class="nav-sidebar__item">Cloudflare</a>
208
+ </li>
209
+ <li>
210
+ <a href="/docs/how-to-deploy/docker/" class="nav-sidebar__item">Docker</a>
211
+ </li>
212
+ <li>
213
+ <a href="/docs/how-to-deploy/wasmer/" class="nav-sidebar__item">Wasmer</a>
195
214
  </li>
196
215
  </ul>
197
216
  </section>
@@ -244,7 +263,26 @@
244
263
  <section class="nav-sidebar__section">
245
264
  <ul class="nav-sidebar__list">
246
265
  <li>
247
- <a href="/docs/hosted/" class="nav-sidebar__item">Hosted Service</a>
266
+ <a href="/docs/hosted/" class="nav-sidebar__item">MockHttp.org Live</a>
267
+ </li>
268
+ </ul>
269
+ </section>
270
+ <section class="nav-sidebar__section nav-sidebar__section--collapsible">
271
+ <h2 class="nav-sidebar__title">
272
+ <button type="button" class="nav-sidebar__toggle" aria-expanded="true">
273
+ <span class="nav-sidebar__toggle-label">How to Deploy</span>
274
+ <svg class="nav-sidebar__chevron" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>
275
+ </button>
276
+ </h2>
277
+ <ul class="nav-sidebar__list">
278
+ <li>
279
+ <a href="/docs/how-to-deploy/cloudflare/" class="nav-sidebar__item">Cloudflare</a>
280
+ </li>
281
+ <li>
282
+ <a href="/docs/how-to-deploy/docker/" class="nav-sidebar__item">Docker</a>
283
+ </li>
284
+ <li>
285
+ <a href="/docs/how-to-deploy/wasmer/" class="nav-sidebar__item">Wasmer</a>
248
286
  </li>
249
287
  </ul>
250
288
  </section>
@@ -493,7 +531,7 @@
493
531
  <a href="https://docula.org/" target="_blank" rel="noopener noreferrer" class="footer__link" aria-label="Docula">
494
532
  <svg class="footer__bat" xmlns="http://www.w3.org/2000/svg" viewBox="70 110 360 205" fill="currentColor"><path d="M420,173c-16.76-18-72.78-36.65-131.59-30.58A160.15,160.15,0,0,0,269,120.55c-3.78,4.52-11.15,9.45-19,9.45s-15.23-4.93-19-9.45a160.15,160.15,0,0,0-19.4,21.83C152.78,136.31,96.76,154.94,80,173c48.86,5.86,79.5,34.09,79.5,72.06,52.37,0,77,28,90.5,59.94C263.54,273,288.13,245,340.5,245,340.5,207,371.14,178.8,420,173Z"/><circle cx="239.19" cy="145.36" r="3.32" fill="#fff"/><circle cx="260.81" cy="145.36" r="3.32" fill="#fff"/></svg>
495
533
  </a>
496
- <span class="footer__updated">updated: 2026-09-18</span>
534
+ <span class="footer__updated">updated: 2026-10-20</span>
497
535
  </footer>
498
536
  <script src="/css/highlight/highlight.min.js"></script>
499
537
  <script>
@@ -35,7 +35,7 @@
35
35
  </script>
36
36
  <title>MockHTTP - Getting Started</title>
37
37
  <script type="application/ld+json">
38
- {"@context":"https://schema.org","@type":"TechArticle","headline":"Getting Started","description":"","url":"https://mockhttp.org/docs/","publisher":{"@type":"Organization","name":"MockHTTP"},"dateModified":"2026-09-18","keywords":[]}
38
+ {"@context":"https://schema.org","@type":"TechArticle","headline":"Getting Started","description":"","url":"https://mockhttp.org/docs/","publisher":{"@type":"Organization","name":"MockHTTP"},"dateModified":"2026-10-20","keywords":[]}
39
39
  </script>
40
40
  </head>
41
41
 
@@ -191,7 +191,26 @@
191
191
  <section class="nav-sidebar__section">
192
192
  <ul class="nav-sidebar__list">
193
193
  <li>
194
- <a href="/docs/hosted/" class="nav-sidebar__item">Hosted Service</a>
194
+ <a href="/docs/hosted/" class="nav-sidebar__item">MockHttp.org Live</a>
195
+ </li>
196
+ </ul>
197
+ </section>
198
+ <section class="nav-sidebar__section nav-sidebar__section--collapsible">
199
+ <h2 class="nav-sidebar__title">
200
+ <button type="button" class="nav-sidebar__toggle" aria-expanded="true">
201
+ <span class="nav-sidebar__toggle-label">How to Deploy</span>
202
+ <svg class="nav-sidebar__chevron" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>
203
+ </button>
204
+ </h2>
205
+ <ul class="nav-sidebar__list">
206
+ <li>
207
+ <a href="/docs/how-to-deploy/cloudflare/" class="nav-sidebar__item">Cloudflare</a>
208
+ </li>
209
+ <li>
210
+ <a href="/docs/how-to-deploy/docker/" class="nav-sidebar__item">Docker</a>
211
+ </li>
212
+ <li>
213
+ <a href="/docs/how-to-deploy/wasmer/" class="nav-sidebar__item">Wasmer</a>
195
214
  </li>
196
215
  </ul>
197
216
  </section>
@@ -244,7 +263,26 @@
244
263
  <section class="nav-sidebar__section">
245
264
  <ul class="nav-sidebar__list">
246
265
  <li>
247
- <a href="/docs/hosted/" class="nav-sidebar__item">Hosted Service</a>
266
+ <a href="/docs/hosted/" class="nav-sidebar__item">MockHttp.org Live</a>
267
+ </li>
268
+ </ul>
269
+ </section>
270
+ <section class="nav-sidebar__section nav-sidebar__section--collapsible">
271
+ <h2 class="nav-sidebar__title">
272
+ <button type="button" class="nav-sidebar__toggle" aria-expanded="true">
273
+ <span class="nav-sidebar__toggle-label">How to Deploy</span>
274
+ <svg class="nav-sidebar__chevron" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>
275
+ </button>
276
+ </h2>
277
+ <ul class="nav-sidebar__list">
278
+ <li>
279
+ <a href="/docs/how-to-deploy/cloudflare/" class="nav-sidebar__item">Cloudflare</a>
280
+ </li>
281
+ <li>
282
+ <a href="/docs/how-to-deploy/docker/" class="nav-sidebar__item">Docker</a>
283
+ </li>
284
+ <li>
285
+ <a href="/docs/how-to-deploy/wasmer/" class="nav-sidebar__item">Wasmer</a>
248
286
  </li>
249
287
  </ul>
250
288
  </section>
@@ -277,7 +315,7 @@
277
315
  <li><a href="/docs/bins/">Bins</a> — capture and inspect incoming HTTP requests (great for webhook debugging)</li>
278
316
  <li><code>@fastify/helmet</code> built in by default</li>
279
317
  <li>Built with Node.js, TypeScript, and Fastify</li>
280
- <li>Deploy via Docker or Node.js</li>
318
+ <li>Run it in Node.js, or deploy with <a href="/docs/how-to-deploy/docker/">Docker</a>, <a href="/docs/how-to-deploy/cloudflare/">Cloudflare Workers</a>, or <a href="/docs/how-to-deploy/wasmer/">Wasmer Edge</a></li>
281
319
  <li>Free hosted service at <a href="https://mockhttp.org">mockhttp.org</a>, running on Cloudflare</li>
282
320
  <li>Documentation site and interactive <a href="/api/">OpenAPI reference</a></li>
283
321
  <li>Auto-detect the next port that is not in use</li>
@@ -314,6 +352,7 @@
314
352
  <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(response);
315
353
  <span class="hljs-keyword">await</span> mock.<span class="hljs-title function_">close</span>(); <span class="hljs-comment">// stop the server</span>
316
354
  </code></pre>
355
+ <p>Step-by-step deploy guides: <a href="/docs/how-to-deploy/docker/">Docker</a>, <a href="/docs/how-to-deploy/cloudflare/">Cloudflare</a>, and <a href="/docs/how-to-deploy/wasmer/">Wasmer</a>.</p>
317
356
  </main>
318
357
  <aside class="content-aside">
319
358
  <h2 class="content-aside__title">TABLE OF CONTENTS</h2>
@@ -336,7 +375,7 @@
336
375
  <a href="https://docula.org/" target="_blank" rel="noopener noreferrer" class="footer__link" aria-label="Docula">
337
376
  <svg class="footer__bat" xmlns="http://www.w3.org/2000/svg" viewBox="70 110 360 205" fill="currentColor"><path d="M420,173c-16.76-18-72.78-36.65-131.59-30.58A160.15,160.15,0,0,0,269,120.55c-3.78,4.52-11.15,9.45-19,9.45s-15.23-4.93-19-9.45a160.15,160.15,0,0,0-19.4,21.83C152.78,136.31,96.76,154.94,80,173c48.86,5.86,79.5,34.09,79.5,72.06,52.37,0,77,28,90.5,59.94C263.54,273,288.13,245,340.5,245,340.5,207,371.14,178.8,420,173Z"/><circle cx="239.19" cy="145.36" r="3.32" fill="#fff"/><circle cx="260.81" cy="145.36" r="3.32" fill="#fff"/></svg>
338
377
  </a>
339
- <span class="footer__updated">updated: 2026-09-18</span>
378
+ <span class="footer__updated">updated: 2026-10-20</span>
340
379
  </footer>
341
380
  <script src="/css/highlight/highlight.min.js"></script>
342
381
  <script>
@@ -35,7 +35,7 @@
35
35
  </script>
36
36
  <title>MockHTTP - Library API</title>
37
37
  <script type="application/ld+json">
38
- {"@context":"https://schema.org","@type":"TechArticle","headline":"Library API","description":"","url":"https://mockhttp.org/docs/library/","publisher":{"@type":"Organization","name":"MockHTTP"},"dateModified":"2026-09-18","keywords":[]}
38
+ {"@context":"https://schema.org","@type":"TechArticle","headline":"Library API","description":"","url":"https://mockhttp.org/docs/library/","publisher":{"@type":"Organization","name":"MockHTTP"},"dateModified":"2026-10-20","keywords":[]}
39
39
  </script>
40
40
  </head>
41
41
 
@@ -191,7 +191,26 @@
191
191
  <section class="nav-sidebar__section">
192
192
  <ul class="nav-sidebar__list">
193
193
  <li>
194
- <a href="/docs/hosted/" class="nav-sidebar__item">Hosted Service</a>
194
+ <a href="/docs/hosted/" class="nav-sidebar__item">MockHttp.org Live</a>
195
+ </li>
196
+ </ul>
197
+ </section>
198
+ <section class="nav-sidebar__section nav-sidebar__section--collapsible">
199
+ <h2 class="nav-sidebar__title">
200
+ <button type="button" class="nav-sidebar__toggle" aria-expanded="true">
201
+ <span class="nav-sidebar__toggle-label">How to Deploy</span>
202
+ <svg class="nav-sidebar__chevron" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>
203
+ </button>
204
+ </h2>
205
+ <ul class="nav-sidebar__list">
206
+ <li>
207
+ <a href="/docs/how-to-deploy/cloudflare/" class="nav-sidebar__item">Cloudflare</a>
208
+ </li>
209
+ <li>
210
+ <a href="/docs/how-to-deploy/docker/" class="nav-sidebar__item">Docker</a>
211
+ </li>
212
+ <li>
213
+ <a href="/docs/how-to-deploy/wasmer/" class="nav-sidebar__item">Wasmer</a>
195
214
  </li>
196
215
  </ul>
197
216
  </section>
@@ -244,7 +263,26 @@
244
263
  <section class="nav-sidebar__section">
245
264
  <ul class="nav-sidebar__list">
246
265
  <li>
247
- <a href="/docs/hosted/" class="nav-sidebar__item">Hosted Service</a>
266
+ <a href="/docs/hosted/" class="nav-sidebar__item">MockHttp.org Live</a>
267
+ </li>
268
+ </ul>
269
+ </section>
270
+ <section class="nav-sidebar__section nav-sidebar__section--collapsible">
271
+ <h2 class="nav-sidebar__title">
272
+ <button type="button" class="nav-sidebar__toggle" aria-expanded="true">
273
+ <span class="nav-sidebar__toggle-label">How to Deploy</span>
274
+ <svg class="nav-sidebar__chevron" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>
275
+ </button>
276
+ </h2>
277
+ <ul class="nav-sidebar__list">
278
+ <li>
279
+ <a href="/docs/how-to-deploy/cloudflare/" class="nav-sidebar__item">Cloudflare</a>
280
+ </li>
281
+ <li>
282
+ <a href="/docs/how-to-deploy/docker/" class="nav-sidebar__item">Docker</a>
283
+ </li>
284
+ <li>
285
+ <a href="/docs/how-to-deploy/wasmer/" class="nav-sidebar__item">Wasmer</a>
248
286
  </li>
249
287
  </ul>
250
288
  </section>
@@ -295,7 +333,6 @@
295
333
  <li><a href="#binsgetrequestbinid-reqid"><code>bins.getRequest(binId, reqId)</code></a></li>
296
334
  <li><a href="#binsclearrequestsbinid"><code>bins.clearRequests(binId)</code></a></li>
297
335
  <li><a href="#binsrecordrequestbinid-raw"><code>bins.recordRequest(binId, raw)</code></a></li>
298
- <li><a href="#binsstart--binsstop"><code>bins.start()</code> / <code>bins.stop()</code></a></li>
299
336
  <li><a href="#binsmaxbodysize--binsmaxrequestsperbin--binsdefaultttlms"><code>bins.maxBodySize</code> / <code>bins.maxRequestsPerBin</code> / <code>bins.defaultTtlMs</code></a></li>
300
337
  </ul>
301
338
  </li>
@@ -330,7 +367,6 @@
330
367
  <li><code>logging?</code>: boolean - Enable logging (default: true)</li>
331
368
  <li><code>staticFiles?</code>: boolean - Serve files from the package <code>public/</code> directory (default: true)</li>
332
369
  <li><code>pluginTimeout?</code>: number - Fastify plugin boot timeout in milliseconds; <code>0</code> disables it (default: Fastify's timeout)</li>
333
- <li><code>startBins?</code>: boolean - Start the request-bin cleanup timer during <code>initialize()</code> (default: true)</li>
334
370
  <li><code>httpBin?</code>: HttpBinOptions - Configure which httpbin routes to enable
335
371
  <ul>
336
372
  <li><code>httpMethods?</code>: boolean - Enable HTTP method routes (default: true)</li>
@@ -364,7 +400,6 @@
364
400
  <li><code>logging</code>: boolean - Get/set logging enabled state</li>
365
401
  <li><code>staticFiles</code>: boolean - Get/set whether files from <code>public/</code> are served</li>
366
402
  <li><code>pluginTimeout</code>: number | undefined - Get/set Fastify plugin boot timeout</li>
367
- <li><code>startBins</code>: boolean - Get/set whether bin cleanup starts during <code>initialize()</code></li>
368
403
  <li><code>rateLimit</code>: RateLimitPluginOptions | undefined - Get/set rate limiting options</li>
369
404
  <li><code>httpBin</code>: HttpBinOptions - Get/set httpbin route options</li>
370
405
  <li><code>https</code>: HttpsOptions | undefined - Get/set HTTPS configuration</li>
@@ -373,7 +408,7 @@
373
408
  <li><code>http1</code>: boolean - Get/set HTTP/1.1 fallback for HTTP/2 with HTTPS</li>
374
409
  <li><code>server</code>: FastifyInstance - Get/set the Fastify server instance</li>
375
410
  <li><code>taps</code>: TapManager - Get/set the TapManager instance</li>
376
- <li><code>bins</code>: BinManager - Get/set the BinManager instance for request bins</li>
411
+ <li><code>bins</code>: MockHttpBins - Get or set the request bins</li>
377
412
  </ul>
378
413
  <h3 id="methods">Methods</h3>
379
414
  <h4 id="async-initialize"><code>async initialize()</code></h4>
@@ -414,32 +449,31 @@
414
449
  <h4 id="async-registerbinroutesfastifyinstance"><code>async registerBinRoutes(fastifyInstance?)</code></h4>
415
450
  <p>Register the request bin routes — management at <code>/bins</code> and capture at <code>/b/:id</code>.</p>
416
451
  <h2 id="bins-request-capture">Bins (Request Capture)</h2>
417
- <p>Access the BinManager via <code>mockHttp.bins</code> to manage request bins programmatically. See <a href="#request-bins">Request Bins</a> for usage examples.</p>
452
+ <p>Use <code>mockHttp.bins</code> to control request bins. See <a href="#request-bins">Request Bins</a> for usage examples.</p>
418
453
  <h3 id="binscreatebin"><code>bins.createBin()</code></h3>
419
- <p>Create a new bin with the configured TTL.</p>
420
- <p><strong>Returns:</strong> <code>Bin</code> — <code>{ id, createdAt, expiresAt, requestCount }</code></p>
454
+ <p>Create a new bin with the configured TTL. Throws when Keyv does not store the bin.</p>
455
+ <p><strong>Returns:</strong> <code>Promise&#x3C;Bin></code> — <code>{ id, createdAt, expiresAt, requestCount }</code></p>
421
456
  <h3 id="binsgetbinid"><code>bins.getBin(id)</code></h3>
422
- <p>Look up a bin by id. Returns <code>undefined</code> if the bin does not exist or has expired (and lazily removes the expired entry).</p>
423
- <p><strong>Returns:</strong> <code>Bin | undefined</code></p>
457
+ <p>Look up a bin by id. Returns <code>undefined</code> if the bin does not exist or Keyv has expired it. When the Keyv instance has an <code>error</code> listener, a failed read also returns <code>undefined</code>.</p>
458
+ <p><strong>Returns:</strong> <code>Promise&#x3C;Bin | undefined></code></p>
424
459
  <h3 id="binslistbins"><code>bins.listBins()</code></h3>
425
- <p>List all non-expired bins.</p>
426
- <p><strong>Returns:</strong> <code>Bin[]</code></p>
460
+ <p>List the bins that Keyv still holds.</p>
461
+ <p><strong>Returns:</strong> <code>Promise&#x3C;Bin[]></code></p>
427
462
  <h3 id="binsdeletebinid"><code>bins.deleteBin(id)</code></h3>
428
- <p>Delete a bin and all its captured requests.</p>
429
- <p><strong>Returns:</strong> <code>boolean</code> — <code>true</code> if the bin existed</p>
463
+ <p>Delete a bin and all its captured requests. The delete waits for captures already queued for that bin.</p>
464
+ <p><strong>Returns:</strong> <code>Promise&#x3C;boolean></code> — <code>true</code> when the bin existed</p>
430
465
  <h3 id="binsgetrequestsbinid"><code>bins.getRequests(binId)</code></h3>
431
466
  <p>List captured requests for a bin, newest first.</p>
432
- <p><strong>Returns:</strong> <code>CapturedRequest[]</code></p>
467
+ <p><strong>Returns:</strong> <code>Promise&#x3C;CapturedRequest[]></code></p>
433
468
  <h3 id="binsgetrequestbinid-reqid"><code>bins.getRequest(binId, reqId)</code></h3>
434
469
  <p>Look up a single captured request.</p>
435
- <p><strong>Returns:</strong> <code>CapturedRequest | undefined</code></p>
470
+ <p><strong>Returns:</strong> <code>Promise&#x3C;CapturedRequest | undefined></code></p>
436
471
  <h3 id="binsclearrequestsbinid"><code>bins.clearRequests(binId)</code></h3>
437
- <p>Clear all captured requests in a bin (the bin itself is preserved).</p>
472
+ <p>Clear all captured requests in a bin. The bin stays. Throws when Keyv does not store the change.</p>
473
+ <p><strong>Returns:</strong> <code>Promise&#x3C;boolean></code> — <code>false</code> when the bin does not exist</p>
438
474
  <h3 id="binsrecordrequestbinid-raw"><code>bins.recordRequest(binId, raw)</code></h3>
439
- <p>Manually record a captured request. Returns <code>undefined</code> if the bin does not exist or is expired. Normally invoked by the capture route, but available for programmatic use.</p>
440
- <p><strong>Returns:</strong> <code>CapturedRequest | undefined</code></p>
441
- <h3 id="binsstart--binsstop"><code>bins.start()</code> / <code>bins.stop()</code></h3>
442
- <p>Start or stop the periodic cleanup of expired bins. <code>MockHttp.start()</code> and <code>MockHttp.close()</code> call these automatically. The interval is <code>unref()</code>'d so it never keeps the Node process alive.</p>
475
+ <p>Manually record a captured request. Returns <code>undefined</code> if the bin does not exist. Throws when Keyv does not store the capture. Normally invoked by the capture route, but available for programmatic use.</p>
476
+ <p><strong>Returns:</strong> <code>Promise&#x3C;CapturedRequest | undefined></code></p>
443
477
  <h3 id="binsmaxbodysize--binsmaxrequestsperbin--binsdefaultttlms"><code>bins.maxBodySize</code> / <code>bins.maxRequestsPerBin</code> / <code>bins.defaultTtlMs</code></h3>
444
478
  <p>Read-only getters for the currently-configured limits.</p>
445
479
  <h2 id="taps-response-injection">Taps (Response Injection)</h2>
@@ -515,7 +549,7 @@
515
549
  <a href="https://docula.org/" target="_blank" rel="noopener noreferrer" class="footer__link" aria-label="Docula">
516
550
  <svg class="footer__bat" xmlns="http://www.w3.org/2000/svg" viewBox="70 110 360 205" fill="currentColor"><path d="M420,173c-16.76-18-72.78-36.65-131.59-30.58A160.15,160.15,0,0,0,269,120.55c-3.78,4.52-11.15,9.45-19,9.45s-15.23-4.93-19-9.45a160.15,160.15,0,0,0-19.4,21.83C152.78,136.31,96.76,154.94,80,173c48.86,5.86,79.5,34.09,79.5,72.06,52.37,0,77,28,90.5,59.94C263.54,273,288.13,245,340.5,245,340.5,207,371.14,178.8,420,173Z"/><circle cx="239.19" cy="145.36" r="3.32" fill="#fff"/><circle cx="260.81" cy="145.36" r="3.32" fill="#fff"/></svg>
517
551
  </a>
518
- <span class="footer__updated">updated: 2026-09-18</span>
552
+ <span class="footer__updated">updated: 2026-10-20</span>
519
553
  </footer>
520
554
  <script src="/css/highlight/highlight.min.js"></script>
521
555
  <script>
@@ -35,7 +35,7 @@
35
35
  </script>
36
36
  <title>MockHTTP - Taps</title>
37
37
  <script type="application/ld+json">
38
- {"@context":"https://schema.org","@type":"TechArticle","headline":"Taps","description":"","url":"https://mockhttp.org/docs/taps/","publisher":{"@type":"Organization","name":"MockHTTP"},"dateModified":"2026-09-18","keywords":[]}
38
+ {"@context":"https://schema.org","@type":"TechArticle","headline":"Taps","description":"","url":"https://mockhttp.org/docs/taps/","publisher":{"@type":"Organization","name":"MockHTTP"},"dateModified":"2026-10-20","keywords":[]}
39
39
  </script>
40
40
  </head>
41
41
 
@@ -191,7 +191,26 @@
191
191
  <section class="nav-sidebar__section">
192
192
  <ul class="nav-sidebar__list">
193
193
  <li>
194
- <a href="/docs/hosted/" class="nav-sidebar__item">Hosted Service</a>
194
+ <a href="/docs/hosted/" class="nav-sidebar__item">MockHttp.org Live</a>
195
+ </li>
196
+ </ul>
197
+ </section>
198
+ <section class="nav-sidebar__section nav-sidebar__section--collapsible">
199
+ <h2 class="nav-sidebar__title">
200
+ <button type="button" class="nav-sidebar__toggle" aria-expanded="true">
201
+ <span class="nav-sidebar__toggle-label">How to Deploy</span>
202
+ <svg class="nav-sidebar__chevron" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>
203
+ </button>
204
+ </h2>
205
+ <ul class="nav-sidebar__list">
206
+ <li>
207
+ <a href="/docs/how-to-deploy/cloudflare/" class="nav-sidebar__item">Cloudflare</a>
208
+ </li>
209
+ <li>
210
+ <a href="/docs/how-to-deploy/docker/" class="nav-sidebar__item">Docker</a>
211
+ </li>
212
+ <li>
213
+ <a href="/docs/how-to-deploy/wasmer/" class="nav-sidebar__item">Wasmer</a>
195
214
  </li>
196
215
  </ul>
197
216
  </section>
@@ -244,7 +263,26 @@
244
263
  <section class="nav-sidebar__section">
245
264
  <ul class="nav-sidebar__list">
246
265
  <li>
247
- <a href="/docs/hosted/" class="nav-sidebar__item">Hosted Service</a>
266
+ <a href="/docs/hosted/" class="nav-sidebar__item">MockHttp.org Live</a>
267
+ </li>
268
+ </ul>
269
+ </section>
270
+ <section class="nav-sidebar__section nav-sidebar__section--collapsible">
271
+ <h2 class="nav-sidebar__title">
272
+ <button type="button" class="nav-sidebar__toggle" aria-expanded="true">
273
+ <span class="nav-sidebar__toggle-label">How to Deploy</span>
274
+ <svg class="nav-sidebar__chevron" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>
275
+ </button>
276
+ </h2>
277
+ <ul class="nav-sidebar__list">
278
+ <li>
279
+ <a href="/docs/how-to-deploy/cloudflare/" class="nav-sidebar__item">Cloudflare</a>
280
+ </li>
281
+ <li>
282
+ <a href="/docs/how-to-deploy/docker/" class="nav-sidebar__item">Docker</a>
283
+ </li>
284
+ <li>
285
+ <a href="/docs/how-to-deploy/wasmer/" class="nav-sidebar__item">Wasmer</a>
248
286
  </li>
249
287
  </ul>
250
288
  </section>
@@ -443,7 +481,7 @@ mock.<span class="hljs-property">taps</span>.<span class="hljs-title function_">
443
481
  <a href="https://docula.org/" target="_blank" rel="noopener noreferrer" class="footer__link" aria-label="Docula">
444
482
  <svg class="footer__bat" xmlns="http://www.w3.org/2000/svg" viewBox="70 110 360 205" fill="currentColor"><path d="M420,173c-16.76-18-72.78-36.65-131.59-30.58A160.15,160.15,0,0,0,269,120.55c-3.78,4.52-11.15,9.45-19,9.45s-15.23-4.93-19-9.45a160.15,160.15,0,0,0-19.4,21.83C152.78,136.31,96.76,154.94,80,173c48.86,5.86,79.5,34.09,79.5,72.06,52.37,0,77,28,90.5,59.94C263.54,273,288.13,245,340.5,245,340.5,207,371.14,178.8,420,173Z"/><circle cx="239.19" cy="145.36" r="3.32" fill="#fff"/><circle cx="260.81" cy="145.36" r="3.32" fill="#fff"/></svg>
445
483
  </a>
446
- <span class="footer__updated">updated: 2026-09-18</span>
484
+ <span class="footer__updated">updated: 2026-10-20</span>
447
485
  </footer>
448
486
  <script src="/css/highlight/highlight.min.js"></script>
449
487
  <script>
@@ -1 +1 @@
1
- <?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>MockHTTP</title><link>https://mockhttp.org/</link><description>HTTP mock server and httpbin replacement for API testing. Run it at mockhttp.org, in Docker, or in Node.js.</description><lastBuildDate>Fri, 18 Sep 2026 22:54:19 GMT</lastBuildDate><atom:link href="https://mockhttp.org/feed.xml" rel="self" type="application/rss+xml" /><item><title>Getting Started</title><link>https://mockhttp.org/docs/</link><guid isPermaLink="true">https://mockhttp.org/docs/</guid><description>tests GitHub license codecov npm npm Docker Pulls mockhttp.org A simple HTTP server for mocking responses in tests. Inspired by httpbin and built with Node.js and Fastify. Run it at mockhttp.org, with Docker (jaredwray/mockhttp), or in Node...</description></item><item><title>HTTPS and HTTP/2</title><link>https://mockhttp.org/docs/https/</link><guid isPermaLink="true">https://mockhttp.org/docs/https/</guid><description>MockHttp supports HTTPS with auto-generated self-signed certificates or your own custom certificates. No external dependencies are required — certificate generation uses only Node.js built-in crypto. The simplest way to enable HTTPS is to p...</description></item><item><title>Taps</title><link>https://mockhttp.org/docs/taps/</link><guid isPermaLink="true">https://mockhttp.org/docs/taps/</guid><description>The injection/tap feature allows you to &quot;tap into&quot; the request flow and inject custom responses for specific requests. This is particularly useful for: Offline testing - Mock external API responses without network access Testing edge cases...</description></item><item><title>Bins</title><link>https://mockhttp.org/docs/bins/</link><guid isPermaLink="true">https://mockhttp.org/docs/bins/</guid><description>Bins are ephemeral URL endpoints that capture incoming HTTP requests so you can inspect them later. They&apos;re the inverse of Taps: instead of injecting a response, they record everything they receive. Useful for: Debugging webhooks — point St...</description></item><item><title>Configuration</title><link>https://mockhttp.org/docs/configuration/</link><guid isPermaLink="true">https://mockhttp.org/docs/configuration/</guid><description>MockHttp supports rate limiting using @fastify/rate-limit. Rate limiting is enabled by default at 1000 requests per minute with localhost (127.0.0.1 and ::1) excluded from rate limiting. By default, MockHttp applies the following rate limit...</description></item><item><title>Library API</title><link>https://mockhttp.org/docs/library/</link><guid isPermaLink="true">https://mockhttp.org/docs/library/</guid><description>Parameters: options? (MockHttpOptions): port?: number - The port to listen on (default: 3000) host?: string - The host to listen on (default: &apos;0.0.0.0&apos;) autoDetectPort?: boolean - Auto-detect next available port if in use (default: true) he...</description></item><item><title>Hosted Service</title><link>https://mockhttp.org/docs/hosted/</link><guid isPermaLink="true">https://mockhttp.org/docs/hosted/</guid><description>mockhttp.org is a free hosted instance of this codebase for testing. It runs on a Cloudflare Worker (no containers): documentation is served from Workers Assets, and mock APIs such as /get and /post run in the Worker. The service is globall...</description></item></channel></rss>
1
+ <?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>MockHTTP</title><link>https://mockhttp.org/</link><description>HTTP mock server and httpbin replacement for API testing. Run it at mockhttp.org, in Docker, or in Node.js.</description><lastBuildDate>Tue, 20 Oct 2026 00:19:31 GMT</lastBuildDate><atom:link href="https://mockhttp.org/feed.xml" rel="self" type="application/rss+xml" /><item><title>Getting Started</title><link>https://mockhttp.org/docs/</link><guid isPermaLink="true">https://mockhttp.org/docs/</guid><description>tests GitHub license codecov npm npm Docker Pulls mockhttp.org A simple HTTP server for mocking responses in tests. Inspired by httpbin and built with Node.js and Fastify. Run it at mockhttp.org, with Docker (jaredwray/mockhttp), or in Node...</description></item><item><title>HTTPS and HTTP/2</title><link>https://mockhttp.org/docs/https/</link><guid isPermaLink="true">https://mockhttp.org/docs/https/</guid><description>MockHttp supports HTTPS with auto-generated self-signed certificates or your own custom certificates. No external dependencies are required — certificate generation uses only Node.js built-in crypto. The simplest way to enable HTTPS is to p...</description></item><item><title>Taps</title><link>https://mockhttp.org/docs/taps/</link><guid isPermaLink="true">https://mockhttp.org/docs/taps/</guid><description>The injection/tap feature allows you to &quot;tap into&quot; the request flow and inject custom responses for specific requests. This is particularly useful for: Offline testing - Mock external API responses without network access Testing edge cases...</description></item><item><title>Bins</title><link>https://mockhttp.org/docs/bins/</link><guid isPermaLink="true">https://mockhttp.org/docs/bins/</guid><description>Bins are ephemeral URL endpoints that capture incoming HTTP requests so you can inspect them later. They&apos;re the inverse of Taps: instead of injecting a response, they record everything they receive. Useful for: Debugging webhooks — point St...</description></item><item><title>Configuration</title><link>https://mockhttp.org/docs/configuration/</link><guid isPermaLink="true">https://mockhttp.org/docs/configuration/</guid><description>MockHttp supports rate limiting using @fastify/rate-limit. Rate limiting is enabled by default at 1000 requests per minute with localhost (127.0.0.1 and ::1) excluded from rate limiting. By default, MockHttp applies the following rate limit...</description></item><item><title>Library API</title><link>https://mockhttp.org/docs/library/</link><guid isPermaLink="true">https://mockhttp.org/docs/library/</guid><description>Parameters: options? (MockHttpOptions): port?: number - The port to listen on (default: 3000) host?: string - The host to listen on (default: &apos;0.0.0.0&apos;) autoDetectPort?: boolean - Auto-detect next available port if in use (default: true) he...</description></item><item><title>MockHttp.org Live</title><link>https://mockhttp.org/docs/hosted/</link><guid isPermaLink="true">https://mockhttp.org/docs/hosted/</guid><description>mockhttp.org is a free hosted instance of this codebase for testing. It runs on a Cloudflare Worker (no containers): documentation is served from Workers Assets, and mock APIs such as /get and /post run in the Worker. The service is globall...</description></item><item><title>Cloudflare</title><link>https://mockhttp.org/docs/how-to-deploy/cloudflare/</link><guid isPermaLink="true">https://mockhttp.org/docs/how-to-deploy/cloudflare/</guid><description>Deploy MockHTTP as a Cloudflare Worker. Workers Assets serve the docs site, and the Worker handles mock API routes.</description></item><item><title>Docker</title><link>https://mockhttp.org/docs/how-to-deploy/docker/</link><guid isPermaLink="true">https://mockhttp.org/docs/how-to-deploy/docker/</guid><description>Run MockHTTP from the jaredwray/mockhttp image, with Docker Compose, or by building the image from this repository.</description></item><item><title>Wasmer</title><link>https://mockhttp.org/docs/how-to-deploy/wasmer/</link><guid isPermaLink="true">https://mockhttp.org/docs/how-to-deploy/wasmer/</guid><description>Deploy the MockHTTP Node.js server to Wasmer Edge with app.yaml, Anybuild, and wasmer deploy.</description></item></channel></rss>
@@ -35,7 +35,7 @@
35
35
  </script>
36
36
  <title>MockHTTP - Getting Started</title>
37
37
  <script type="application/ld+json">
38
- {"@context":"https://schema.org","@type":"TechArticle","headline":"Getting Started","description":"","url":"https://mockhttp.org/","publisher":{"@type":"Organization","name":"MockHTTP"},"dateModified":"2026-09-18","keywords":[]}
38
+ {"@context":"https://schema.org","@type":"TechArticle","headline":"Getting Started","description":"","url":"https://mockhttp.org/","publisher":{"@type":"Organization","name":"MockHTTP"},"dateModified":"2026-10-20","keywords":[]}
39
39
  </script>
40
40
  </head>
41
41
 
@@ -191,7 +191,26 @@
191
191
  <section class="nav-sidebar__section">
192
192
  <ul class="nav-sidebar__list">
193
193
  <li>
194
- <a href="/docs/hosted/" class="nav-sidebar__item">Hosted Service</a>
194
+ <a href="/docs/hosted/" class="nav-sidebar__item">MockHttp.org Live</a>
195
+ </li>
196
+ </ul>
197
+ </section>
198
+ <section class="nav-sidebar__section nav-sidebar__section--collapsible">
199
+ <h2 class="nav-sidebar__title">
200
+ <button type="button" class="nav-sidebar__toggle" aria-expanded="true">
201
+ <span class="nav-sidebar__toggle-label">How to Deploy</span>
202
+ <svg class="nav-sidebar__chevron" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>
203
+ </button>
204
+ </h2>
205
+ <ul class="nav-sidebar__list">
206
+ <li>
207
+ <a href="/docs/how-to-deploy/cloudflare/" class="nav-sidebar__item">Cloudflare</a>
208
+ </li>
209
+ <li>
210
+ <a href="/docs/how-to-deploy/docker/" class="nav-sidebar__item">Docker</a>
211
+ </li>
212
+ <li>
213
+ <a href="/docs/how-to-deploy/wasmer/" class="nav-sidebar__item">Wasmer</a>
195
214
  </li>
196
215
  </ul>
197
216
  </section>
@@ -244,7 +263,26 @@
244
263
  <section class="nav-sidebar__section">
245
264
  <ul class="nav-sidebar__list">
246
265
  <li>
247
- <a href="/docs/hosted/" class="nav-sidebar__item">Hosted Service</a>
266
+ <a href="/docs/hosted/" class="nav-sidebar__item">MockHttp.org Live</a>
267
+ </li>
268
+ </ul>
269
+ </section>
270
+ <section class="nav-sidebar__section nav-sidebar__section--collapsible">
271
+ <h2 class="nav-sidebar__title">
272
+ <button type="button" class="nav-sidebar__toggle" aria-expanded="true">
273
+ <span class="nav-sidebar__toggle-label">How to Deploy</span>
274
+ <svg class="nav-sidebar__chevron" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>
275
+ </button>
276
+ </h2>
277
+ <ul class="nav-sidebar__list">
278
+ <li>
279
+ <a href="/docs/how-to-deploy/cloudflare/" class="nav-sidebar__item">Cloudflare</a>
280
+ </li>
281
+ <li>
282
+ <a href="/docs/how-to-deploy/docker/" class="nav-sidebar__item">Docker</a>
283
+ </li>
284
+ <li>
285
+ <a href="/docs/how-to-deploy/wasmer/" class="nav-sidebar__item">Wasmer</a>
248
286
  </li>
249
287
  </ul>
250
288
  </section>
@@ -277,7 +315,7 @@
277
315
  <li><a href="/docs/bins/">Bins</a> — capture and inspect incoming HTTP requests (great for webhook debugging)</li>
278
316
  <li><code>@fastify/helmet</code> built in by default</li>
279
317
  <li>Built with Node.js, TypeScript, and Fastify</li>
280
- <li>Deploy via Docker or Node.js</li>
318
+ <li>Run it in Node.js, or deploy with <a href="/docs/how-to-deploy/docker/">Docker</a>, <a href="/docs/how-to-deploy/cloudflare/">Cloudflare Workers</a>, or <a href="/docs/how-to-deploy/wasmer/">Wasmer Edge</a></li>
281
319
  <li>Free hosted service at <a href="https://mockhttp.org">mockhttp.org</a>, running on Cloudflare</li>
282
320
  <li>Documentation site and interactive <a href="/api/">OpenAPI reference</a></li>
283
321
  <li>Auto-detect the next port that is not in use</li>
@@ -314,6 +352,7 @@
314
352
  <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">log</span>(response);
315
353
  <span class="hljs-keyword">await</span> mock.<span class="hljs-title function_">close</span>(); <span class="hljs-comment">// stop the server</span>
316
354
  </code></pre>
355
+ <p>Step-by-step deploy guides: <a href="/docs/how-to-deploy/docker/">Docker</a>, <a href="/docs/how-to-deploy/cloudflare/">Cloudflare</a>, and <a href="/docs/how-to-deploy/wasmer/">Wasmer</a>.</p>
317
356
  </main>
318
357
  <aside class="content-aside">
319
358
  <h2 class="content-aside__title">TABLE OF CONTENTS</h2>
@@ -336,7 +375,7 @@
336
375
  <a href="https://docula.org/" target="_blank" rel="noopener noreferrer" class="footer__link" aria-label="Docula">
337
376
  <svg class="footer__bat" xmlns="http://www.w3.org/2000/svg" viewBox="70 110 360 205" fill="currentColor"><path d="M420,173c-16.76-18-72.78-36.65-131.59-30.58A160.15,160.15,0,0,0,269,120.55c-3.78,4.52-11.15,9.45-19,9.45s-15.23-4.93-19-9.45a160.15,160.15,0,0,0-19.4,21.83C152.78,136.31,96.76,154.94,80,173c48.86,5.86,79.5,34.09,79.5,72.06,52.37,0,77,28,90.5,59.94C263.54,273,288.13,245,340.5,245,340.5,207,371.14,178.8,420,173Z"/><circle cx="239.19" cy="145.36" r="3.32" fill="#fff"/><circle cx="260.81" cy="145.36" r="3.32" fill="#fff"/></svg>
338
377
  </a>
339
- <span class="footer__updated">updated: 2026-09-18</span>
378
+ <span class="footer__updated">updated: 2026-10-20</span>
340
379
  </footer>
341
380
  <script src="/css/highlight/highlight.min.js"></script>
342
381
  <script>