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
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
51
|
-
|
|
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
|
}
|
package/oclif.manifest.json
CHANGED