@fecommunity/reactpress-server 1.0.0-beta.4 → 1.0.0-beta.6
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.
- package/bin/reactpress-server.js +3 -13
- package/package.json +1 -1
package/bin/reactpress-server.js
CHANGED
|
@@ -42,14 +42,14 @@ program
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
//
|
|
46
|
-
console.log(chalk.cyan('📋 Creating configuration file
|
|
45
|
+
// 使用完整的基础配置模板,包含客户端和服务端配置
|
|
46
|
+
console.log(chalk.cyan('📋 Creating configuration file with essential settings...\n'));
|
|
47
47
|
|
|
48
48
|
// 生成JWT密钥
|
|
49
49
|
const jwtSecret = require('crypto').randomBytes(32).toString('hex');
|
|
50
50
|
console.log(chalk.green('🔐 Generated JWT secret'));
|
|
51
51
|
|
|
52
|
-
// 创建.env文件 -
|
|
52
|
+
// 创建.env文件 - 包含所有基础配置
|
|
53
53
|
const envContent = `# Database Config
|
|
54
54
|
DB_HOST=127.0.0.1
|
|
55
55
|
DB_PORT=3306
|
|
@@ -57,7 +57,6 @@ DB_USER=reactpress
|
|
|
57
57
|
DB_PASSWD=reactpress
|
|
58
58
|
DB_DATABASE=reactpress
|
|
59
59
|
|
|
60
|
-
# JWT Secret
|
|
61
60
|
JWT_SECRET=${jwtSecret}
|
|
62
61
|
|
|
63
62
|
# Client Config
|
|
@@ -65,15 +64,6 @@ CLIENT_SITE_URL=http://localhost:3001
|
|
|
65
64
|
|
|
66
65
|
# Server Config
|
|
67
66
|
SERVER_SITE_URL=http://localhost:${options.port}
|
|
68
|
-
SERVER_PORT=${options.port}
|
|
69
|
-
SERVER_API_PREFIX=/api
|
|
70
|
-
|
|
71
|
-
# Admin Config
|
|
72
|
-
ADMIN_USER=admin
|
|
73
|
-
ADMIN_PASSWD=admin
|
|
74
|
-
|
|
75
|
-
# Environment
|
|
76
|
-
NODE_ENV=development
|
|
77
67
|
`;
|
|
78
68
|
|
|
79
69
|
fs.writeFileSync(envPath, envContent);
|