UNPKG

openapi-metadata

Version:

Auto-Generate OpenAPI specifications from Typescript decorators

27 lines (26 loc) 665 B
/** * Generates HTML to display Scalar UI. * * @see https://scalar.com/ */ export function generateScalarUI(url: string) { return ` <!doctype html> <html> <head> <title>API Reference</title> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> </head> <body> <script id="api-reference" data-url="${url}" data-proxy-url="https://proxy.scalar.com"></script> <script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script> </body> </html> `; }