ts-quiz— ~/loading.ts
tsc --watch● loading…
// tsc --watch · type-checking modules…
await load("loading.ts")
// streaming server components
◇ tsc 6.0.3 · compiling…UTF-8◇ loading…
from fastapi import FastAPI, Depends
def auth(token: str = ''):
return token == 'ok'
def admin(ok: bool = Depends(auth)):
return ok
app = FastAPI()
@app.get('/a')
def page(is_admin: bool = Depends(admin)):
return is_admin