Add source-build docs, optional SERVER_PORT config
This commit is contained in:
1 parent
d24b852f2a
commit
8e3aa558b0
1484 files changed
+174765
-1
No files matched your search
@@ -13,7 +13,12 @@ const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const app = express();
|
||||
const PORT = process.env.PORT || 3000;
|
||||
|
||||
// 服务端配置(config.js,浏览器端加载同名文件但不影响服务端)
|
||||
const CONFIG = require('./config');
|
||||
|
||||
// 监听端口:环境变量 PORT 优先,其次 config.js 的 SERVER_PORT,最后默认 3000
|
||||
const PORT = process.env.PORT || CONFIG.SERVER_PORT || 3000;
|
||||
const JWT_SECRET = process.env.JWT_SECRET || 'forumlify-secret-key-change-me-in-production';
|
||||
|
||||
// ============================================================
|
||||
|
||||
Reference in new issue
Block a user