package routes import ( "net/http" "teraclone/internal/handler" "teraclone/internal/handlers" "teraclone/internal/service" ) func Register(mux *http.ServeMux, appService *service.AppService, apiUpstream string) error { return RegisterWithSessionUpstream(mux, appService, apiUpstream, "http://127.0.0.1:8081") } func RegisterWithSessionUpstream(mux *http.ServeMux, appService *service.AppService, apiUpstream string, sessionUpstream string) error { legacyHandler := handler.NewAppHandler(appService) legacyHandler.RegisterLegacyRoutes(mux) deviceHandler, err := handlers.NewDeviceHandlerWithSessionUpstream(appService, apiUpstream, sessionUpstream) if err != nil { return err } deviceHandler.RegisterRoutes(mux) mux.HandleFunc("/health", legacyHandler.HandleHealth) return nil }