Files
MTKJPAY/PORT_CONFIG.md

47 lines
1017 B
Markdown
Raw Normal View History

# 端口配置说明
## 端口分配
- **前端Vite开发服务器**: `3000`
- **后端Spring Boot应用**: `8082`
## 访问地址
- **前端访问地址**: `http://localhost:3000`
- **后端API地址**: `http://localhost:8082`
- **Druid监控**: `http://localhost:8082/druid`
## 代理配置
前端通过 Vite 代理将 `/api/*` 请求转发到后端:
```javascript
// vite.config.js
proxy: {
'/api': {
target: 'http://127.0.0.1:8082',
changeOrigin: true
}
}
```
## 启动顺序
1. **启动后端**:运行 `MtPayApplication`,监听 `8082` 端口
2. **启动前端**:运行 `npm run dev`,监听 `3000` 端口
## 配置文件位置
### 前端
- `MTKJPAY-FRONT/vite.config.js` - Vite配置端口 3000
### 后端
- `MTKJPAY/mt-pay/src/main/resources/application.yml` - 主配置,端口 8082
## 注意事项
1. 确保两个端口都没有被其他程序占用
2. 前端启动后会自动通过代理访问后端
3. 如果修改端口,需要同步更新相关配置