kiwi-vpn/api/kiwi_vpn_api/main.py

12 lines
269 B
Python
Raw Normal View History

2022-03-14 00:10:10 +00:00
from fastapi import Depends, FastAPI
from fastapi.security import OAuth2PasswordBearer
app = FastAPI()
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
@app.get("/items/")
async def read_items(token: str = Depends(oauth2_scheme)):
return {"token": token}