-
Notifications
You must be signed in to change notification settings - Fork 435
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
Conflicts with existing wildcard #136
Comments
hi @thinkingmik , the panic you're getting is thrown by the gin router and it's a known limitation of the router package the gin project uses You can check it with this simple script:
|
Ok thank you, but if I want to use another router like I would modify the package krakend
import (
cors "github.com/devopsfaith/krakend-cors/mux"
httpsecure "github.com/devopsfaith/krakend-httpsecure/mux"
"github.com/devopsfaith/krakend/config"
"github.com/devopsfaith/krakend/logging"
"github.com/gorilla/mux"
)
// NewEngine creates a new mux engine with some default values and a secure middleware
func NewEngine(cfg config.ServiceConfig, logger logging.Logger) *mux.Engine {
engine := mux.DefaultEngine()
//engine.RedirectTrailingSlash = true
//engine.RedirectFixedPath = true
//engine.HandleMethodNotAllowed = true
if corsMw := cors.New(cfg.ExtraConfig); corsMw != nil {
engine.Use(corsMw)
}
if err := httpsecure.Register(cfg.ExtraConfig, engine); err != nil {
logger.Warning(err)
}
return engine
} |
you should also modify the |
Yes of course, thank you. |
hi @thinkingmik I am very interested in the same solution as you asked for in this thread. Do you have published your solution for that topic? Thanks in advance, |
Hi @tfluehmann sorry but I haven't implemented this solution... I'm still using the standard |
hi @thinkingmik I'm getting the same error as yours. May I know how did you resolve the issue while keep using the standard |
Hi @novalagung, with |
I have been fascinated by krakend for several days but today I got to the wall. I have no idea how to organize endpoint naming for the existing API with this limitation. |
I know @wkozi :( but after days of work writing endpoints with this limitation you will get used to it. However, if you have existing APIs you will change only the exposed For example: "method": "GET",
"endpoint": "/exposed/endpoint/ping",
"backend": [
{
"host": ["http://localhost:3000"],
"url_pattern": "/different/ping",
"sd": "static"
}
] |
@wkozi I ended up creating my own web service, utilizing the krakend middleware with gorilla mux router. |
Of course, I understand the limitations and know the workaround, but now I migrate from Netflix Zuul and decompose our API. I understand api gateway as a product = a set of business methods from different microservices. In my opinion, the fact that I have to change my current endpoints, e.g.
to
is a big limitation ;-( |
@novalagung it's very interesting. I understand that this requires modification of krakend sources. Can I see it somewhere? |
This issue was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link. |
Version: devopsfaith/krakend:0.10.0-dev
Problem
I'm trying to define the gateway endpoints, this is my
krakend.json
:Error
I'm getting this error when I'm running the docker container:
Question
Why I'm getting this error? Is there a way to define a static endpoint like
/api/exhibitions/search
without have conflicts with wildcard's endpoints?The text was updated successfully, but these errors were encountered: