devopsfaith / krakend-examples Goto Github PK
View Code? Open in Web Editor NEWCollection of examples for the KrakenD framework
License: Apache License 2.0
Collection of examples for the KrakenD framework
License: Apache License 2.0
Why shall I test this krakenD example? There is no description, no motivation, and no sense at all visible.
I create a simple demo like /user/info/{uid}
, it works fine with gin example, but the chi example always return 404 not found, I dig around and found URIParser.GetEndpointPath
would convert endpoint from /user/info/{uid}
to /user/info/:uid
, which adapted by colon style gin router, but failed in brace style router by chi.
I had to add a convert function after config parsed to change the endpoint url back to brace style and it finally works, any good idea besides this one?
var reg = regexp.MustCompile(`:\w+`)
func convert(cfg config.ServiceConfig) {
for _, e := range cfg.Endpoints {
if !strings.Contains(e.Endpoint, ":") {
continue
}
e.Endpoint = reg.ReplaceAllStringFunc(e.Endpoint, func(s string) string {
return "{" + s[1:] + "}"
})
}
}
Hi,
Hope you are all well !
I tried to run the httpcache example but it displays the following error:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x91c62d]
goroutine 1 [running]:
github.com/devopsfaith/krakend/router/gin.ginRouter.Run(0xc000138c80, 0xf21998, 0x0, 0x0, 0xc000114ee0, 0xb1fd20, 0xc00010f580, 0xb2ed80, 0xc00010f520, 0x0, ...)
/go/pkg/mod/github.com/devopsfaith/[email protected]/router/gin/router.go:96 +0x3ad
main.main()
/app/main.go:56 +0x657
Is it possible to fix ? how to fix it ?
Thanks in advance for your insights or inputs on that topic.
Cheers,
X
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.