nodebbs 0.0.1 → 0.0.2

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.
@@ -3,6 +3,7 @@ import { select, confirm } from '@inquirer/prompts';
3
3
  import { checkDocker, runCompose, waitForHealth, execCompose, getComposeFiles } from '../../utils/docker.js';
4
4
  import { initEnv, checkEnv } from '../../utils/env.js';
5
5
  import { logger } from '../../utils/logger.js';
6
+ import dotenv from 'dotenv';
6
7
  export default class Deploy extends Command {
7
8
  static description = '部署 NodeBBS';
8
9
  static flags = {
@@ -82,8 +83,13 @@ export default class Deploy extends Command {
82
83
  // 9. Show Info
83
84
  logger.header('部署完成!');
84
85
  logger.info(`环境: ${env}`);
85
- console.log(` Web 前端: http://localhost:3100`);
86
- console.log(` API 文档: http://localhost:7100/docs`);
87
- console.log(` 健康检查: http://localhost:7100/api`);
86
+ // 读取 .env 文件获取端口配置
87
+ const envConfig = dotenv.config().parsed || {};
88
+ const webPort = envConfig.WEB_PORT || '3100';
89
+ const apiPort = envConfig.API_PORT || '7100';
90
+ console.log(` Web 前端: http://localhost:${webPort}`);
91
+ console.log(` API 服务: http://localhost:${apiPort}`);
92
+ console.log(` API 文档: http://localhost:${apiPort}/docs`);
93
+ console.log(` 健康检查: http://localhost:${apiPort}/api`);
88
94
  }
89
95
  }
@@ -2,6 +2,7 @@ import { Command, Flags } from '@oclif/core';
2
2
  import { select } from '@inquirer/prompts';
3
3
  import { runCompose, getComposeFiles } from '../../utils/docker.js';
4
4
  import { logger } from '../../utils/logger.js';
5
+ import dotenv from 'dotenv';
5
6
  export default class Dev extends Command {
6
7
  static description = '启动开发环境';
7
8
  static flags = {
@@ -47,7 +48,12 @@ export default class Dev extends Command {
47
48
  await runCompose(files, ['up', '-d'], isBuiltIn);
48
49
  logger.success('服务已启动!');
49
50
  }
50
- console.log(` Web 前端: http://localhost:3100`);
51
- console.log(` API 文档: http://localhost:7100/docs`);
51
+ // 读取 .env 文件获取端口配置
52
+ const envConfig = dotenv.config().parsed || {};
53
+ const webPort = envConfig.WEB_PORT || '3100';
54
+ const apiPort = envConfig.API_PORT || '7100';
55
+ console.log(` Web 前端: http://localhost:${webPort}`);
56
+ console.log(` API 服务: http://localhost:${apiPort}`);
57
+ console.log(` API 文档: http://localhost:${apiPort}/docs`);
52
58
  }
53
59
  }
@@ -480,5 +480,5 @@
480
480
  ]
481
481
  }
482
482
  },
483
- "version": "0.0.1"
483
+ "version": "0.0.2"
484
484
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nodebbs",
3
3
  "description": "A new CLI generated with oclif",
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "author": "wengqianshan",
6
6
  "bin": {
7
7
  "nodebbs": "./bin/run.js"