Skip to main content

No project description provided

Project description

FastAPI Self Hosting Docs

一个用于 FastAPI 应用程序的自托管文档解决方案,提供本地化的 Swagger UI 和 ReDoc 文档界面。

特性

  • 🚀 自托管文档: 所有文档资源都托管在应用程序内部,无需外部依赖
  • 📖 Swagger UI: 提供交互式的 API 文档界面
  • 📋 ReDoc: 提供美观的 API 文档展示
  • 🎨 自定义样式: 包含自定义的 favicon 和样式
  • 🔧 简单集成: 只需一行代码即可替换标准 FastAPI 应用

安装

pip install fastapi-self-hosting-docs

快速开始

基本用法

# 使用 FastAPI Self Hosting Docs 替代标准 FastAPI

# from fastapi import FastAPI
from fastapi_self_hosting_docs import FastAPI
app = FastAPI()

# 启动应用
import uvicorn
uvicorn.run(app)

Swagger UI

ReDoc

文档访问

启动应用后,可以通过以下地址访问文档:

  • Swagger UI: http://127.0.0.1:8000/docs
  • ReDoc: http://127.0.0.1:8000/redoc

与标准 FastAPI 的区别

特性 标准 FastAPI FastAPI Self Hosting Docs
文档资源 外部 CDN 本地托管
Swagger UI /docs /docs
ReDoc /redoc /redoc
依赖 无额外依赖 仅需 fastapi
自定义 favicon 不支持 支持

许可证

本项目采用 Apache 2.0 许可证。详情请参阅 LICENSE 文件。

贡献

欢迎提交 Issue 和 Pull Request!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_self_hosting_docs-0.6.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_self_hosting_docs-0.6.0-py3-none-any.whl (747.3 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_self_hosting_docs-0.6.0.tar.gz.

File metadata

File hashes

Hashes for fastapi_self_hosting_docs-0.6.0.tar.gz
Algorithm Hash digest
SHA256 11898e1e5a757988bca281d2bcf36b6fb14ce7c8010784a5910e485c8884bc87
MD5 69eabfb9914fce68e79a4623ceec5076
BLAKE2b-256 b2fb3ab35635f44e233b796f669b64c27c3b932aa83ac0af6df16edad3fcabd2

See more details on using hashes here.

File details

Details for the file fastapi_self_hosting_docs-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_self_hosting_docs-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 902b764624dac97535936d3a6dc0c57355a754a8d8e9058af3829a5065d4dd04
MD5 578e47d26fb94572e3cffd236eb603f4
BLAKE2b-256 4f8e9d2537bbb7c9950d81c77846a09b2c2694c16839154c7d87052a43b4acd6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page