Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group "/" and "" routes are separate and should be the same #71

Closed
briangwaltney opened this issue Jul 24, 2023 · 2 comments
Closed

Group "/" and "" routes are separate and should be the same #71

briangwaltney opened this issue Jul 24, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@briangwaltney
Copy link

briangwaltney commented Jul 24, 2023

.group("users", app =>
    app.get("/", ()=>{
       return true
    }
)

The above code will generate a 404 error when going to /users. The trailing slash must be added to find the route. /users/ is required for the routing to be found.

This is also the situation regardless of the group.

If the path is

.get("/users", ()=>{})

going to /users/ also fails.

I think /users should default to the "/users/" route and vice versa.

@SaltyAom
Copy link
Member

This will be configurable on an upcoming Elysia 0.6.0 via config.strictPath.

Please leave this issue open until Elysia 0.6.0 stable is released.

@SaltyAom SaltyAom self-assigned this Jul 28, 2023
@SaltyAom SaltyAom added the enhancement New feature or request label Jul 30, 2023
@SaltyAom
Copy link
Member

SaltyAom commented Aug 6, 2023

This should be fixed in Elysia 0.6, see Strict Path

@SaltyAom SaltyAom closed this as completed Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants