Skip to content

Routing issue with groups #1568

@andrei-dascalu

Description

@andrei-dascalu

Issue Description

I have a group with a certain prefix like “/api/root”.
Now, I’m adding paths to this group.

myGroup.GET("/", myHandler1)
myGroup.GET("/path", myHandler2)

Checklist

  • Dependencies installed
  • No typos
  • Searched existing issues and docs

Expected behaviour

myHandler one handles both ”/api/root/" and “/api/root”

Actual behaviour

myHandler one will only respond to ”/api/root/", but not “/api/root”

This is more of a question (I also asked it in the forums roughly 2 weeks ago), as I'm not sure what's the intended behavior here.

         router := echo.New()
	myGroup := router.Group("/api/root")

	myGroup.GET("/pages", api.FindPages)
	myGroup.GET("/", api.GetIndex)

At the moment I need to add

     myGroup.GET("", api.GetIndex)

To make sure /api/root/ and /api/root behave the same way.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions