mirror of
https://github.com/fastapi/fastapi.git
synced 2025-12-23 22:29:34 -05:00
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com> Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
14 lines
236 B
Python
14 lines
236 B
Python
from fastapi import FastAPI
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/users/me")
|
|
async def read_user_me():
|
|
return {"user_id": "the current user"}
|
|
|
|
|
|
@app.get("/users/{user_id}")
|
|
async def read_user(user_id: str):
|
|
return {"user_id": user_id}
|