const AppServer = require('./app') const dotenv = require('dotenv') // 加载环境变量 dotenv.config() // 创建服务器实例 const server = new AppServer() // 获取端口配置,默认为3100(避免与前端开发服务器冲突) const port = process.env.CHAT_SERVER_PORT || 3100 // 启动服务器 server.start(port)