UNPKG

nestjs-redox

Version:

This NestJS module enables to auto-generate beautiful API docs using Swagger and Redoc. It supports NestJS 10, ExpressJS and Fastify.

2 lines (1 loc) 1.86 kB
export declare const REDOC_HANDLEBAR = "\n<!DOCTYPE html>\n<html>\n <head>\n <title>{{ document.info.title }}</title>\n <meta charset=\"utf-8\" />\n {{#if redoxOptions.favicon.url }}\n <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"{{{ redoxOptions.favicon.url }}}\" />\n {{/if}}\n {{#unless redoxOptions.disableGoogleFont}}\n <link href=\"https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700\" rel=\"stylesheet\">\n {{/unless}}\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <style>\n body, html, #redoc-container {\n padding:0;\n margin:0;\n }\n </style>\n {{#unless redoxOptions.standalone}}\n <script src=\"https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js\" nonce=\"{{{nonce}}}\"> </script>\n {{else}}\n <script src=\"{{baseUrlForRedocUI}}redoc.standalone.js\" nonce=\"{{{nonce}}}\"></script>\n {{/unless}}\n </head>\n <body>\n <div id=\"redoc-container\"></div>\n\n <script type=\"application/javascript\" nonce=\"{{{nonce}}}\">\n function b64ToString(base64String) {\n const binString = atob(base64String);\n const decodedBytes = Uint8Array.from(binString, (m) => m.codePointAt(0));\n return new TextDecoder().decode(decodedBytes);\n }\n\n {{#if documentURL}}\n Redoc.init('{{documentURL}}', {{{json redocOptions}}}, document.getElementById('redoc-container'))\n {{else}}\n const base64Document = `\n{{{ base64Document }}}\n`;\n\n try {\n const spec = JSON.parse(b64ToString(base64Document));\n Redoc.init(spec, {{{json redocOptions}}}, document.getElementById('redoc-container'))\n } catch (e) {\n alert(e?.message ?? e);\n }\n {{/if}}\n </script>\n </body>\n</html>\n";