Skip to content

Commit

Permalink
feat: allow the swagger path to be configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Junjiequan committed Sep 19, 2024
1 parent 2a450ad commit 1d2f8c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ Valid environment variables for the .env file. See [.env.example](/.env.example)
| `ES_FIELDS_LIMIT` | number | | The total number of fields in an index. | 1000 |
| `ES_REFRESH` | string | | If set to `wait_for`, Elasticsearch will wait till data is inserted into the specified index before returning a response. | false |
| `LOGGERS_CONFIG_FILE` | string | | The file name for loggers configuration, located in the project root directory. | "loggers.json" |
| `SWAGGER_PATH` | string | Yes | swaggerPath is the path where the swagger UI will be available| "explorer"|

## Migrating from the old SciCat Backend

Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ async function bootstrap() {
docExpansion: "none",
},
};
const swaggerPath = process.env.SWAGGER_PATH || "explorer";

SwaggerModule.setup("explorer", app, document, swaggerOptions);
SwaggerModule.setup(swaggerPath, app, document, swaggerOptions);

app.useGlobalPipes(
/**
Expand Down

0 comments on commit 1d2f8c6

Please sign in to comment.