Closed clamoriniere1A closed 6 years ago
I did the modification that allows retrieving the broker endpoints and handlers configuration behind an http.Handler
interface: https://github.com/clamoriniere1A/osb-broker-lib/blob/feature/externallHTTPServer/pkg/server/server.go#L30
Let me know if this approach is fine for you.
Looks good to me, I suggest making a PR for this back into pmorie/osb-broker-lib
. It is backwards compatible and only opens up the options for adopters. Nice work @clamoriniere1A
Currently, it isn't possible to register the Broker
APISurface
handlers on an external HTTP server, since the registration was included in theserver.New(...)
method that instantiates also theserver.Server
(https://github.com/pmorie/osb-broker-lib/blob/master/pkg/server/server.go#L30)In some case, we may want to use the "osb-broker-lib" in an existing process like an "Operator". Also, this existing process may have already an HTTP server running (maybe with an existing Prometheus endpoint already registered...). And so, It will be useful to register only the
APISurface
endpoints and handler on the existing HTTP server, instead of having a second HTTP server only for the Broker part.