3 changed files with 27 additions and 6 deletions
@ -1,10 +1,13 @@ |
|||||
from uuid import UUID |
|
||||
|
|
||||
from fastapi import FastAPI |
from fastapi import FastAPI |
||||
|
|
||||
app = FastAPI() |
app = FastAPI() |
||||
|
|
||||
|
|
||||
@app.get("/items/{item_id}") |
@app.get("/users/me") |
||||
async def read_item(item_id: UUID): |
async def read_user_me(): |
||||
return {"item_id": item_id} |
return {"user_id": "the current user"} |
||||
|
|
||||
|
|
||||
|
@app.get("/users/{user_id}") |
||||
|
async def read_user(user_id: str): |
||||
|
return {"user_id": user_id} |
||||
|
Loading…
Reference in new issue