Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/next/pages/api/v2/index.ts
Views: 687
import { docsApiRoute } from "next-rest-framework";1import { join } from "node:path";23import basePath from "lib/base-path";456export default docsApiRoute({7// deniedPaths: [...] // Ignore endpoints from the generated OpenAPI spec.8// allowedPaths: [...], // Explicitly set which endpoints to include in the generated OpenAPI spec.9openApiObject: {10info: {11title: "CoCalc API",12version: "1.0.0",13summary: `This is the CoCalc HTTP API. To get started, you'll need to14[create an API key](https://doc.cocalc.com/apikeys.html).`,15description: `This is the CoCalc HTTP API. To get started, you'll need to16[create an API key](https://doc.cocalc.com/apikeys.html).`,17},18externalDocs: {19url: "https://doc.cocalc.com",20description: "Check out the CoCalc documentation and user guide.",21},22components: {23securitySchemes: {24BasicAuth: {25type: "http",26scheme: "basic",27description: `The \`password\` field should be left blank, and the \`username\`28field should contain the client's API key.`,29},30},31},32security: [33{34BasicAuth: [],35},36],37servers: [38{39description: "CoCalc Production",40url: "https://cocalc.com",41variables: {42apiKey: {43default: "",44description: `API key to use for the request. An account-wide key may be45obtained by visiting https://cocalc.com/settings/account`,46},47},48},49{50description: "CoCalc Dev",51url: "http://localhost:5000",52variables: {53apiKey: {54default: "",55description: `API key to use for the request. An account-wide key may be56obtained by visiting http://localhost:5000/settings/account`,57},58},59},60],61},62openApiJsonPath: join(basePath, "openapi.json"),63docsConfig: {64provider: "redoc", // redoc | swagger-ui65title: "CoCalc API",66description: "",67logoUrl: "https://cocalc.com/_next/static/media/full.0a70e50d.svg",68ogConfig: {69title: "CoCalc HTTP API (v2)",70type: "website",71url: "https://cocalc.com/api/v2",72imageUrl: "https://cocalc.com/webapp/favicon.ico",73},74},75});767778