File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,8 +76,35 @@ if (env.customTrackerScriptName) {
7676}
7777
7878if ( env . allowOpenapi ) {
79- app . use ( '/open/_ui' , swaggerUI . serve , swaggerUI . setup ( trpcOpenapiDocument ) ) ;
79+ app . use (
80+ '/open/_swagger' ,
81+ swaggerUI . serve ,
82+ swaggerUI . setup ( trpcOpenapiDocument )
83+ ) ;
8084 app . use ( '/open/_document' , ( req , res ) => res . send ( trpcOpenapiDocument ) ) ;
85+ app . use ( '/open/_ui' , ( req , res ) =>
86+ res . send ( `
87+ <html>
88+ <head>
89+ <title>Tianji OpenAPI</title>
90+ <script src="https://unpkg.com/@stoplight/elements/web-components.min.js"></script>
91+ <link rel="stylesheet" href="https://unpkg.com/@stoplight/elements/styles.min.css">
92+ </head>
93+ <body>
94+ <elements-api
95+ apiDescriptionUrl="/open/_document"
96+ router="hash"
97+ layout="responsive"
98+ logo="https://tianji.msgbyte.com/img/logo.svg"
99+ />
100+ <style>
101+ a[href^='https://stoplight.io'] {
102+ display: none !important;
103+ }
104+ </style>
105+ </body>
106+ </html>` )
107+ ) ;
81108 app . use ( '/open' , trpcOpenapiHttpHandler ) ;
82109}
83110
You can’t perform that action at this time.
0 commit comments