-
FastAPI HTTP 响应头禁止输出 date 和 server 字段
响应头 FastAPI默认会输出date和server,这两个字段来自于uvicorn。 content-length: 22 content-type: application/json da
-
FastAPI 使用 APIRouter 实现模块化路由
原始路由 最快速的定义路由的方式是在main.py中直接创建app对象,然后使用@app.xxx注解定义HTTP接口。 from fastapi import FastAPI app = Fast
-
FastAPI 使用 loguru 处理日志
安装依赖 uv add loguru 配置类 from __future__ import annotations import logging import os import sys fro
-
Python uv 安装 FastAPI
初始化项目 uv init my-demo 添加依赖 uv add fastapi[standard] 开发模式运行 FastAPI uv run fastapi dev 生产模式运行 Fas