In "fastapi" you can use "Depends" in a endpoint:
from fastapi import Depends
@app.get("/depends_test")
def getdbtest(request, db: Session = Depends(get_db) ):
return db.query(Token).all()
Is there any "Depends" equivalent in FastHTML?
In "fastapi" you can use "Depends" in a endpoint:
from fastapi import Depends
@app.get("/depends_test")
def getdbtest(request, db: Session = Depends(get_db) ):
return db.query(Token).all()
Is there any "Depends" equivalent in FastHTML?
Looks like it is not a feature on fastHTML but a discussed topic. This issue on github offers a solution github. But since fastapi and fastHTML are focusing on diffrent logics there are diffrent tools included.