diff --git a/.env.example b/.env.example index bd1e9a2..f31a4df 100644 --- a/.env.example +++ b/.env.example @@ -20,3 +20,4 @@ COS_SECRET_ID=yourid COS_SECRET_KEY=yourkey COS_REGION=ap-guangzhou COS_BUCKET=examplebucket-1250000000 +SERVER_PREFIX=/ diff --git a/src/main.ts b/src/main.ts index 7962950..1142fc6 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,6 +19,7 @@ async function bootstrap() { .addBearerAuth() .build(); const document = SwaggerModule.createDocument(app, config); + document.servers = [{ url: process.env.SERVER_PREFIX }]; SwaggerModule.setup('docs', app, document, { jsonDocumentUrl: 'docs/json', });