Created
October 13, 2016 17:52
-
-
Save asdine/4c28fb282a22038409e3f9c57b262458 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
"github.com/labstack/echo" | |
"github.com/labstack/echo/engine/standard" | |
) | |
// curl -X GET -k -v "http://127.0.0.1:1323/a/b/d/something" <-- OK | |
// curl -X GET -k -v "http://127.0.0.1:1323/a/b/p/something" <-- Not OK | |
func main() { | |
e := echo.New() | |
// any path will be enough to reproduce the problem | |
g := e.Group("") | |
routes := []string{ | |
"a/b/:id/something", | |
"a/b/:id/other", | |
"a/b/path", | |
} | |
for _, r := range routes { | |
g.GET(r, func(c echo.Context) error { | |
return c.String(http.StatusOK, "OK") | |
}) | |
} | |
err := e.Run(standard.New(":1323")) | |
if err != nil { | |
panic(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment