speedly 2.0.24 → 2.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,12 @@ type InitConfig = {
4
4
  homeHandler?: boolean;
5
5
  errorHandler?: boolean;
6
6
  jsonParser?: boolean;
7
- documentation?: boolean;
7
+ documentation?: boolean | {
8
+ servers: {
9
+ url: string;
10
+ description?: string;
11
+ }[];
12
+ };
8
13
  urlEncodedParser?: boolean;
9
14
  cookieParser?: boolean;
10
15
  staticFiles?: boolean;
@@ -39,7 +39,9 @@ function speedly(config = {}) {
39
39
  console.log("init", 48, fs_1.default.existsSync(path_1.default.join(process.cwd(), "src/module")));
40
40
  if (finalConfig.documentation &&
41
41
  fs_1.default.existsSync(path_1.default.join(process.cwd(), "src/module")))
42
- (0, document_1.default)(app, path_1.default.join(process.cwd(), "src/module"));
42
+ (0, document_1.default)(app, path_1.default.join(process.cwd(), "src/module"), finalConfig.documentation === true
43
+ ? undefined
44
+ : finalConfig.documentation.servers);
43
45
  if (finalConfig.staticFiles)
44
46
  app.use("/static", express_1.default.static("public"));
45
47
  if (finalConfig.homeHandler) {
@@ -242,7 +242,7 @@ function RouterFetcher(baseDir, servers) {
242
242
  title: `${require(path_1.default.join(process.cwd(), "package.json")).name} APIs`,
243
243
  version: "1.0.0",
244
244
  },
245
- servers: [{ url: "/api/v1" }],
245
+ servers,
246
246
  paths,
247
247
  tags,
248
248
  components: {
@@ -4,7 +4,12 @@ type InitConfig = {
4
4
  homeHandler?: boolean;
5
5
  errorHandler?: boolean;
6
6
  jsonParser?: boolean;
7
- documentation?: boolean;
7
+ documentation?: boolean | {
8
+ servers: {
9
+ url: string;
10
+ description?: string;
11
+ }[];
12
+ };
8
13
  urlEncodedParser?: boolean;
9
14
  cookieParser?: boolean;
10
15
  staticFiles?: boolean;
@@ -39,7 +39,9 @@ function speedly(config = {}) {
39
39
  console.log("init", 48, fs_1.default.existsSync(path_1.default.join(process.cwd(), "src/module")));
40
40
  if (finalConfig.documentation &&
41
41
  fs_1.default.existsSync(path_1.default.join(process.cwd(), "src/module")))
42
- (0, document_1.default)(app, path_1.default.join(process.cwd(), "src/module"));
42
+ (0, document_1.default)(app, path_1.default.join(process.cwd(), "src/module"), finalConfig.documentation === true
43
+ ? undefined
44
+ : finalConfig.documentation.servers);
43
45
  if (finalConfig.staticFiles)
44
46
  app.use("/static", express_1.default.static("public"));
45
47
  if (finalConfig.homeHandler) {
@@ -242,7 +242,7 @@ function RouterFetcher(baseDir, servers) {
242
242
  title: `${require(path_1.default.join(process.cwd(), "package.json")).name} APIs`,
243
243
  version: "1.0.0",
244
244
  },
245
- servers: [{ url: "/api/v1" }],
245
+ servers,
246
246
  paths,
247
247
  tags,
248
248
  components: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speedly",
3
- "version": "2.0.24",
3
+ "version": "2.0.26",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/esm/index.d.ts",