index.html 1.3 KB

12345678910111213141516171819202122232425
  1. <!doctype html>
  2. <html lang="en"><head><meta charset="utf-8"><title>smartbotic-vectorapi API</title>
  3. <meta name="viewport" content="width=device-width,initial-scale=1"></head>
  4. <body style="margin:0">
  5. <rapi-doc theme="dark" bg-color="#0b0f17" text-color="#e5e7eb"
  6. render-style="read" show-header="false" allow-try="true"
  7. regular-font="system-ui, sans-serif"></rapi-doc>
  8. <script>
  9. // This page is served from <mount>/docs, with or without a trailing slash,
  10. // and a subpath reverse proxy (e.g. nginx `location /rag/`) strips the prefix
  11. // before the server sees it. So derive the mount prefix here rather than
  12. // hardcoding absolute URLs, which 404 whenever the app is not at the root.
  13. // '/docs' -> '' '/rag/docs' -> '/rag'
  14. // '/docs/' -> '' '/rag/docs/' -> '/rag'
  15. var BASE = location.pathname.replace(/\/docs\/?$/, '');
  16. var doc = document.querySelector('rapi-doc');
  17. doc.setAttribute('spec-url', BASE + '/openapi.json');
  18. // The spec declares no `servers`, so point "Try it" at this same mount.
  19. doc.setAttribute('server-url', location.origin + BASE);
  20. var s = document.createElement('script');
  21. s.type = 'module';
  22. s.src = BASE + '/docs/rapidoc-min.js';
  23. document.body.appendChild(s);
  24. </script>
  25. </body></html>