(
finalPath: string,
app: INestApplication,
customStaticPath?: string
)
| 96 | } |
| 97 | |
| 98 | protected static serveStatic( |
| 99 | finalPath: string, |
| 100 | app: INestApplication, |
| 101 | customStaticPath?: string |
| 102 | ) { |
| 103 | const httpAdapter = app.getHttpAdapter(); |
| 104 | |
| 105 | // See <https://github.com/nestjs/swagger/issues/2543> |
| 106 | const swaggerAssetsPath = customStaticPath |
| 107 | ? resolvePath(customStaticPath) |
| 108 | : getSwaggerAssetsAbsoluteFSPath(); |
| 109 | |
| 110 | if (httpAdapter && httpAdapter.getType() === 'fastify') { |
| 111 | (app as NestFastifyApplication).useStaticAssets({ |
| 112 | root: swaggerAssetsPath, |
| 113 | prefix: finalPath, |
| 114 | decorateReply: false |
| 115 | }); |
| 116 | } else { |
| 117 | (app as NestExpressApplication).useStaticAssets(swaggerAssetsPath, { |
| 118 | prefix: finalPath |
| 119 | }); |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | protected static serveDocuments( |
| 124 | finalPath: string, |
no test coverage detected