初始化鸿蒙应用展示平台项目 - 前后端分离架构
This commit is contained in:
40
backend/README.md
Normal file
40
backend/README.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# 后端 API 服务
|
||||
|
||||
基于 FastAPI 的鸿蒙应用展示平台后端服务。
|
||||
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
# 创建虚拟环境
|
||||
python -m venv venv
|
||||
source venv/bin/activate
|
||||
|
||||
# 安装依赖
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## 配置
|
||||
|
||||
复制 `.env.example` 为 `.env` 并配置数据库连接:
|
||||
|
||||
```env
|
||||
MYSQL_HOST=localhost
|
||||
MYSQL_PORT=3306
|
||||
MYSQL_USER=root
|
||||
MYSQL_PASSWORD=your_password
|
||||
MYSQL_DATABASE=huawei_market
|
||||
```
|
||||
|
||||
## 运行
|
||||
|
||||
```bash
|
||||
python -m app.main
|
||||
```
|
||||
|
||||
服务将在 http://localhost:8000 启动
|
||||
|
||||
## API 文档
|
||||
|
||||
启动服务后访问:
|
||||
- Swagger UI: http://localhost:8000/docs
|
||||
- ReDoc: http://localhost:8000/redoc
|
||||
Reference in New Issue
Block a user