book.py 392 B

123456789101112131415161718
  1. from fastapi import APIRouter
  2. api_book = APIRouter()
  3. @api_book.get("/get")
  4. async def get_test():
  5. return {"method": "get method"}
  6. @api_book.post("/post")
  7. async def post_test():
  8. return {"method": "post method"}
  9. @api_book.put("/put")
  10. async def put_test():
  11. return {"method": "put method"}
  12. @api_book.delete("/delete")
  13. async def delete_test():
  14. return {"method": "delete method"}