You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If one defines a partial path on the controller, the default route ends with a trailing slash:
route("/users")
controllerclassUserController {
route("") //and route("/") both map to /users/sharedvoidlistUsers() {}
}
This might not conform to established conventions. Might an empty route, route("") or route, be treated as the default route and separate from route("/")?
route("/users")
controllerclassUserController {
route//maps to /userssharedvoidlistUsers() {}
route("/") //maps to /users/sharedvoidsomethingElse() {}
}
The text was updated successfully, but these errors were encountered:
I see now that I was wrong in how I stated the problem; I assumed the behavior was by design. This might actually be a bug: Going by the JAX-RS behavior, both /users and /users/ should work, but currently that is not the case:
get("/users", (req, res) => "Hello");//Going to /users/ returns a 404 errorget("/users/", (req, res) => "Hello");//Going to /users returns a 405 error
I would like to second this request, my expectation would be that either "", nothing, or null allows me to access the route without a trailing slash. Stripping off the last / as JAX-RS does would be fine too since it is superfluous anyways.
If one defines a partial path on the controller, the default route ends with a trailing slash:
This might not conform to established conventions. Might an empty route,
route("")
orroute
, be treated as the default route and separate fromroute("/")
?The text was updated successfully, but these errors were encountered: