Feature request
Please describe your feature
Hi, I found the dorplet had split the http_input into http_injector and http_input. We can get the http.Request in droplect.Context.
So I think we can move those middleware:
|
r.Use(sessions.Sessions("session", store)) |
|
r.Use(filter.CORS(), filter.RequestId(), filter.RequestLogHandler(logger), filter.SchemaCheck(), filter.Authentication(), filter.RecoverHandler()) |
|
r.Use(static.Serve("/", static.LocalFile(filepath.Join(conf.WorkDir, conf.WebDir), false))) |
into droplet framework. Then we can have a more clearer code and better response.
First, I want to move the authentication function into droplet.
Describe the solution you'd like
Use the droplet framework to do middleware orchestra work.
|
droplet.Option.Orchestrator = func(mws []droplet.Middleware) []droplet.Middleware { |
|
var newMws []droplet.Middleware |
|
// default middleware order: resp_reshape, auto_input, traffic_log |
|
// We should put err_transform at second to catch all error |
|
newMws = append(newMws, mws[0], &handler.ErrorTransformMiddleware{}) |
|
newMws = append(newMws, mws[1:]...) |
|
return newMws |
|
} |
Feature request
Please describe your feature
Hi, I found the dorplet had split the http_input into
http_injectorandhttp_input. We can get the http.Request in droplect.Context.So I think we can move those middleware:
apisix-dashboard/api/internal/route.go
Lines 56 to 58 in 822aa6d
into droplet framework. Then we can have a more clearer code and better response.
First, I want to move the authentication function into droplet.
Describe the solution you'd like
Use the droplet framework to do middleware orchestra work.
apisix-dashboard/api/cmd/managerapi.go
Lines 61 to 68 in 5f22326