cmd/dendrite: Add support for starting a client-api server

This commit is contained in:
Robert Swain 2017-04-21 15:54:45 +02:00
parent 3d92d2ed8b
commit 8ae95c5906

View file

@ -15,6 +15,7 @@
package main
import (
"github.com/matrix-org/dendrite/clientapi/clientapi-app"
"github.com/matrix-org/dendrite/common"
log "github.com/Sirupsen/logrus"
@ -77,4 +78,23 @@ Environment Variables:
common.SetupLogging(logDir)
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)
}
}
}
}