Skip to content

Commit

Permalink
Add back deleted route
Browse files Browse the repository at this point in the history
  • Loading branch information
No767 committed Nov 11, 2024
1 parent 139ffcd commit 0ade06e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions server/routes/user.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from pydantic import BaseModel
from utils.request import RouteRequest
from utils.router import KanaeRouter


class NotFound(BaseModel):
error: str = "Resource not found"


class GetUser(BaseModel):
user: str


router = KanaeRouter(prefix="/users", tags=["Users"])


@router.get(
"/get",
response_model=GetUser,
responses={200: {"model": GetUser}, 404: {"model": NotFound}},
name="Get users",
)
@router.limiter.limit("1/minute")
async def get_users(request: RouteRequest) -> GetUser:
query = "SELECT 1;"
status = await request.app.pool.execute(query)
return GetUser(user=status)

0 comments on commit 0ade06e

Please sign in to comment.