mirror of
https://github.com/fastapi/fastapi.git
synced 2026-02-14 00:01:17 -05:00
17 lines
281 B
Python
17 lines
281 B
Python
from fastapi import FastAPI
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
openapi_url: str = "/openapi.json"
|
|
|
|
|
|
settings = Settings()
|
|
|
|
app = FastAPI(openapi_url=settings.openapi_url)
|
|
|
|
|
|
@app.get("/")
|
|
def root():
|
|
return {"message": "Hello World"}
|