mockforge-http 0.3.116

HTTP/REST protocol support for MockForge
Documentation
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>MockForge API Docs</title>
  <style>
    body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
    .no-spec {
      display: flex; align-items: center; justify-content: center;
      min-height: 100vh; text-align: center; color: #64748b;
    }
    .no-spec h1 { font-size: 1.5rem; color: #334155; margin-bottom: 0.5rem; }
    .no-spec a { color: #3b82f6; text-decoration: none; }
    .no-spec a:hover { text-decoration: underline; }
  </style>
</head>
<body>
  <div id="no-spec" class="no-spec" style="display: none;">
    <div>
      <h1>No OpenAPI Spec Loaded</h1>
      <p>This mock server is running in config-only mode.</p>
      <p><a href="/__mockforge/routes">View registered routes</a></p>
    </div>
  </div>
  <script id="api-reference" style="display: none;"></script>
  <script>
    // Check if spec is available, then configure and load Scalar
    fetch('/__mockforge/api/spec')
      .then(function(r) {
        if (!r.ok) throw new Error('No spec');
        return r.text();
      })
      .then(function(specContent) {
        var ref = document.getElementById('api-reference');
        ref.removeAttribute('style');
        ref.setAttribute('data-url', '/__mockforge/api/spec');
        ref.setAttribute('data-proxy-url', '');

        var script = document.createElement('script');
        script.src = 'https://cdn.jsdelivr.net/npm/@scalar/api-reference';
        document.body.appendChild(script);
      })
      .catch(function() {
        document.getElementById('no-spec').style.display = 'flex';
      });
  </script>
</body>
</html>