mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-03-03 17:03:10 -06:00
parent
37905f81e6
commit
909c809876
|
|
@ -18,8 +18,6 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
|
|
||||||
"github.com/matrix-org/dendrite/appservice"
|
"github.com/matrix-org/dendrite/appservice"
|
||||||
"github.com/matrix-org/dendrite/federationapi"
|
"github.com/matrix-org/dendrite/federationapi"
|
||||||
"github.com/matrix-org/dendrite/keyserver"
|
"github.com/matrix-org/dendrite/keyserver"
|
||||||
|
|
@ -31,6 +29,7 @@ import (
|
||||||
"github.com/matrix-org/dendrite/setup/mscs"
|
"github.com/matrix-org/dendrite/setup/mscs"
|
||||||
"github.com/matrix-org/dendrite/userapi"
|
"github.com/matrix-org/dendrite/userapi"
|
||||||
uapi "github.com/matrix-org/dendrite/userapi/api"
|
uapi "github.com/matrix-org/dendrite/userapi/api"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
|
|
||||||
_ "github.com/mattn/go-sqlite3"
|
_ "github.com/mattn/go-sqlite3"
|
||||||
)
|
)
|
||||||
|
|
@ -156,6 +155,14 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Expose the matrix APIs directly rather than putting them under a /api path.
|
||||||
|
go func() {
|
||||||
|
base.SetupAndServeHTTP(
|
||||||
|
httpAPIAddr, // internal API
|
||||||
|
httpAddr, // external API
|
||||||
|
nil, nil, // TLS settings
|
||||||
|
)
|
||||||
|
}()
|
||||||
// Handle HTTPS if certificate and key are provided
|
// Handle HTTPS if certificate and key are provided
|
||||||
if *certFile != "" && *keyFile != "" {
|
if *certFile != "" && *keyFile != "" {
|
||||||
go func() {
|
go func() {
|
||||||
|
|
@ -165,15 +172,6 @@ func main() {
|
||||||
certFile, keyFile, // TLS settings
|
certFile, keyFile, // TLS settings
|
||||||
)
|
)
|
||||||
}()
|
}()
|
||||||
} else {
|
|
||||||
// Expose the matrix APIs directly rather than putting them under a /api path.
|
|
||||||
go func() {
|
|
||||||
base.SetupAndServeHTTP(
|
|
||||||
httpAPIAddr, // internal API
|
|
||||||
httpAddr, // external API
|
|
||||||
nil, nil, // TLS settings
|
|
||||||
)
|
|
||||||
}()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// We want to block forever to let the HTTP and HTTPS handler serve the APIs
|
// We want to block forever to let the HTTP and HTTPS handler serve the APIs
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue