📝 Add tutorials python src files

This commit is contained in:
Sebastián Ramírez
2018-12-14 10:02:03 +04:00
parent 9febe9af2a
commit abe695ba9a
13 changed files with 417 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
from fastapi import FastAPI, Security
from fastapi.security import OAuth2PasswordBearer
app = FastAPI()
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/token")
@app.get("/items/")
async def read_items(token: str = Security(oauth2_scheme)):
return {"token": token}