mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-08 07:23:10 -06:00
cmd/dendrite: Add support for starting a client-api server
This commit is contained in:
parent
3d92d2ed8b
commit
8ae95c5906
|
|
@ -15,6 +15,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/matrix-org/dendrite/clientapi/clientapi-app"
|
||||||
"github.com/matrix-org/dendrite/common"
|
"github.com/matrix-org/dendrite/common"
|
||||||
|
|
||||||
log "github.com/Sirupsen/logrus"
|
log "github.com/Sirupsen/logrus"
|
||||||
|
|
@ -77,4 +78,23 @@ Environment Variables:
|
||||||
common.SetupLogging(logDir)
|
common.SetupLogging(logDir)
|
||||||
|
|
||||||
log.Infoln(args)
|
log.Infoln(args)
|
||||||
|
|
||||||
|
if args["serve"] != nil && args["serve"].(bool) {
|
||||||
|
if args["all"] != nil && args["all"].(bool) {
|
||||||
|
log.Panic("'serve all' is not yet supported.")
|
||||||
|
} else {
|
||||||
|
switch serverType := args["<server-type>"]; serverType {
|
||||||
|
case "client-api":
|
||||||
|
log.Infof("Starting %v server...", serverType)
|
||||||
|
clientapi.App(
|
||||||
|
maybeArgToStr(args["--host"]),
|
||||||
|
maybeArgToStr(args["--kafka-hosts"]),
|
||||||
|
maybeArgToStr(args["--room-server-host"]),
|
||||||
|
maybeArgToStr(args["--topic-prefix"]),
|
||||||
|
)
|
||||||
|
default:
|
||||||
|
log.Panicf("Server type '%v' unknown.", serverType)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue