mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-23 22:29:34 -05:00
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com> Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
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"}
|