File size: 971 Bytes
853b993 ec2e14a 853b993 ec2e14a 853b993 ec2e14a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
---
title: Hfbase API
emoji: 🚀
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
pinned: false
---
# HFBase API
基于 Node.js 20 LTS + Python 3.12 的 FastAPI 服务,部署在 HuggingFace Spaces。
## 技术栈
- **Node.js**: 20 LTS (多阶段构建)
- **Python**: 3.12 (运行时)
- **Web 框架**: FastAPI + Uvicorn
- **生产服务器**: Gunicorn + UvicornWorker
- **部署平台**: HuggingFace Spaces (Docker SDK)
## API 端点
- `GET /` - 欢迎信息
- `GET /health` - 健康检查
- `GET /info` - 系统信息
- `GET /docs` - FastAPI 自动文档
## 部署信息
此项目配置为在 HuggingFace Spaces 上运行,使用 Docker SDK 和端口 7860。
### 构建和部署
```bash
# 本地测试
docker build -t hfbase-api .
docker run -p 7860:7860 hfbase-api
# 访问 API
curl http://localhost:7860/health
```
## 配置参考
详细配置参考: [HuggingFace Spaces 配置文档](https://huggingface.co/docs/hub/spaces-config-reference)
|