Beispiel #1
0
// getAPIHandler api handler
func getAPIHandler(conf api.Config) (http.Handler, api.Minio) {
	mux := router.NewRouter()
	minioAPI := api.New()
	apiHandler := registerAPI(mux, minioAPI)
	apiHandler = registerCustomMiddleware(apiHandler, conf)
	return apiHandler, minioAPI
}
Beispiel #2
0
// getAPIHandler api handler
func getAPIHandler(conf api.Config) (http.Handler, api.Minio) {
	var mwHandlers = []api.MiddlewareHandler{
		api.ValidContentTypeHandler,
		api.TimeValidityHandler,
		api.IgnoreResourcesHandler,
		api.ValidateAuthHeaderHandler,
		// api.LoggingHandler, // Disabled logging until we bring in external logging support
		api.CorsHandler,
	}

	mux := router.NewRouter()
	minioAPI := api.New()
	registerAPI(mux, minioAPI)
	apiHandler := registerCustomMiddleware(mux, mwHandlers...)
	return apiHandler, minioAPI
}