SubRouter.add_route
Bug Description
I expected /login to be fine, but it was actually counterintuitive to write it like this
Steps to Reproduce
No response
Your operating system
None
Your Python version (python --version)
None
Your Robyn version
None
Additional Info
No response
@LIghtJUNction
Try this way:
auth_router = SubRouter(__file__, prefix='/api/auth')
@auth_router.post(endpoint="/login")
async def auth_login(request: Request):
return "Auth Login Endpoint"
app.include_router(auth_router)
@LIghtJUNction
Try this way:
auth_router = SubRouter(__file__, prefix='/api/auth') @auth_router.post(endpoint="/login") async def auth_login(request: Request): return "Auth Login Endpoint" app.include_router(auth_router)Of course I know how to write this, which means I need to write these functions in one file. I just think it's counterintuitive.
@sansyrox
Users are getting methods suggested from base class in subrouter, which might confuse some, what is the solution to fix that?
- no option to add routes other than decorators in subRouter
@sansyrox
Users are getting methods suggested from base class in subrouter, which might confuse some, what is the solution to fix that?
- no option to add routes other than decorators in subRouter
Because many people have used fastapi before and write with fastapi's habit, they will think it will be very strange.
@LIghtJUNction
Of course I know how to write this, which means I need to write these functions in one file. I just think it's counterintuitive.
Can you give suggestions for some features required, as you have more experience in using fastapi than me i will try to add those.
Of course I know how to write this, which means I need to write these functions in one file. I just think it's counterintuitive.
Can you give suggestions for some features required, as you have more experience in using fastapi than me i will try to add those.
Thank you, the function I want most is nested child routes, and when I look at the issue, I find that there seems to be something wrong with path normalization (one more slash and one less slash at the end of the path may bypass the verification). If robyn releases the official version, I will definitely use it.