aboutsummaryrefslogtreecommitdiff
path: root/publicroomsapi
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-06-08 15:51:07 +0100
committerGitHub <noreply@github.com>2020-06-08 15:51:07 +0100
commit4f171c56a832c836b0eb21650ee84d56e451dd6a (patch)
treee92059f1dbb784c978b60897d6ac13983d51c1b4 /publicroomsapi
parentcdb9a115715bd5a9e84df5bc95060e2dac1f6d89 (diff)
Split out SetupFooComponent (#1106)
* Split out adding HTTP routes from making internal APIs for clarity * Split out more components * Split out more things * Finish converting * internal mux for internal routes
Diffstat (limited to 'publicroomsapi')
-rw-r--r--publicroomsapi/publicroomsapi.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/publicroomsapi/publicroomsapi.go b/publicroomsapi/publicroomsapi.go
index b53351ff..280ab9e3 100644
--- a/publicroomsapi/publicroomsapi.go
+++ b/publicroomsapi/publicroomsapi.go
@@ -15,6 +15,7 @@
package publicroomsapi
import (
+ "github.com/gorilla/mux"
"github.com/matrix-org/dendrite/clientapi/auth/storage/devices"
"github.com/matrix-org/dendrite/internal/basecomponent"
"github.com/matrix-org/dendrite/publicroomsapi/consumers"
@@ -26,9 +27,10 @@ import (
"github.com/sirupsen/logrus"
)
-// SetupPublicRoomsAPIComponent sets up and registers HTTP handlers for the PublicRoomsAPI
+// AddPublicRoutes sets up and registers HTTP handlers for the PublicRoomsAPI
// component.
-func SetupPublicRoomsAPIComponent(
+func AddPublicRoutes(
+ router *mux.Router,
base *basecomponent.BaseDendrite,
deviceDB devices.Database,
publicRoomsDB storage.Database,
@@ -43,5 +45,5 @@ func SetupPublicRoomsAPIComponent(
logrus.WithError(err).Panic("failed to start public rooms server consumer")
}
- routing.Setup(base.PublicAPIMux, deviceDB, publicRoomsDB, rsAPI, fedClient, extRoomsProvider)
+ routing.Setup(router, deviceDB, publicRoomsDB, rsAPI, fedClient, extRoomsProvider)
}