2022-04-15 12:56:22 +00:00
|
|
|
import Head from "next/head";
|
|
|
|
import SwaggerUI from "swagger-ui-react";
|
|
|
|
|
|
|
|
const requestSnippets = {
|
|
|
|
generators: {
|
|
|
|
curl_bash: {
|
|
|
|
title: "cURL (bash)",
|
|
|
|
syntax: "bash",
|
|
|
|
},
|
|
|
|
curl_powershell: {
|
|
|
|
title: "cURL (PowerShell)",
|
|
|
|
syntax: "powershell",
|
|
|
|
},
|
|
|
|
curl_cmd: {
|
|
|
|
title: "cURL (CMD)",
|
|
|
|
syntax: "bash",
|
|
|
|
},
|
|
|
|
node: {
|
|
|
|
title: "Node",
|
|
|
|
syntax: "node",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
defaultExpanded: true,
|
|
|
|
languages: ["curl_bash"],
|
|
|
|
// e.g. only show curl bash = ["curl_bash"]
|
|
|
|
};
|
|
|
|
export default function APIDocs() {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<Head>
|
|
|
|
<title>Cal.com - Docs - SwaggerUI</title>
|
|
|
|
<meta name="description" content="Generated by create next app" />
|
|
|
|
<link rel="icon" href="/favicon.ico" />
|
|
|
|
</Head>
|
|
|
|
<SwaggerUI
|
|
|
|
requestSnippets={requestSnippets}
|
|
|
|
requestSnippetsEnabled={true}
|
|
|
|
docExpansion="none"
|
|
|
|
operationsSorter="method"
|
|
|
|
filter={true}
|
2022-04-15 17:30:47 +00:00
|
|
|
url={process.env.NEXT_PUBLIC_SWAGGER_DOCS_URL || "https://api.cal.com/api/docs"}
|
2022-04-15 12:56:22 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|