44 "context"
55 "encoding/json"
66 "fmt"
7+ "github.com/hollow-cube/api-server/api/v1Public"
78 "net"
89 "net/http"
910
@@ -152,6 +153,7 @@ func main() {
152153 fx .Provide (newDynamicExporter ),
153154 tracefx .Module ,
154155 fx .Provide (
156+ v1Public .NewServer ,
155157 v4Internal .NewServer ,
156158
157159 v2Public .NewServer ,
@@ -189,6 +191,7 @@ func newKubernetesClient(conf *config.Config) (*kubernetes.Clientset, error) {
189191}
190192
191193type routeHandlerImpl struct {
194+ v1p * v1Public.Server
192195 v4i * v4Internal.Server
193196
194197 public v2Public.StrictServerInterface
@@ -214,6 +217,13 @@ func (v *routeHandlerImpl) Apply(r chi.Router) {
214217 })
215218 r .Handle ("/v4/internal/*" , v4mux )
216219
220+ v1Mux := http .NewServeMux ()
221+ v1Public .RegisterRoutes (v .v1p , v1Public.RegisterParams {
222+ Mux : v1Mux ,
223+ BaseURL : "/v1" ,
224+ })
225+ r .Handle ("/v1/*" , v1Mux )
226+
217227 r .Handle ("/v2/players/*" , v2Public .HandlerFromMuxWithBaseURL (v2Public .NewStrictHandler (v .public , nil ), nil , "/v2/players" ))
218228 r .Handle ("/v2/internal/*" , v2Internal .HandlerFromMuxWithBaseURL (v2Internal .NewStrictHandler (v .internal , nil ), nil , "/v2/internal" ))
219229 r .Handle ("/v2/payments/*" , v2Payments .HandlerFromMuxWithBaseURL (v .payments , nil , "/v2/payments" ))
@@ -241,6 +251,7 @@ func (v *routeHandlerImpl) Apply(r chi.Router) {
241251func makeV2RouteHandler (p struct {
242252 fx.In
243253
254+ V1P * v1Public.Server
244255 V4I * v4Internal.Server
245256 Public v2Public.StrictServerInterface
246257 Internal v2Internal.StrictServerInterface
@@ -253,6 +264,7 @@ func makeV2RouteHandler(p struct {
253264 Discord * discord.Handler
254265}) httpTransport.RouteProvider {
255266 return & routeHandlerImpl {
267+ v1p : p .V1P ,
256268 v4i : p .V4I ,
257269 public : p .Public ,
258270 internal : p .Internal ,
0 commit comments