From 95eb80d6da9cc62e6a96fe559adee062687003e8 Mon Sep 17 00:00:00 2001 From: hippoz <10706925-hippoz@users.noreply.gitlab.com> Date: Mon, 10 Oct 2022 18:55:28 +0300 Subject: [PATCH] add MATRIX_PROTOCOL option --- src/routes/matrix/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/matrix/index.ts b/src/routes/matrix/index.ts index a9e6ac3..9e1c49f 100644 --- a/src/routes/matrix/index.ts +++ b/src/routes/matrix/index.ts @@ -9,6 +9,7 @@ import sendMessage from "../../impl"; const router = express.Router(); +const matrixProtocol = process.env.MATRIX_PROTOCOL ? process.env.MATRIX_PROTOCOL : "http"; const matrixHomeserverBaseUrl = process.env.MATRIX_HOMESERVER_BASE_URL ? process.env.MATRIX_HOMESERVER_BASE_URL : "localhost:3000"; const matrixWaffleAppUrl = process.env.MATRIX_WAFFLE_APP_URL ? process.env.MATRIX_WAFFLE_APP_URL : "localhost:3000"; const matrixDeviceId = "xyz.hippoz.waffle.generic_matrix_client.device"; @@ -155,7 +156,7 @@ router.use((_req, res, next) => { router.get("/.well-known/matrix/client", (req, res) => { res.json({ "m.homeserver": { - "base_url": `http://${matrixHomeserverBaseUrl}` + "base_url": `${matrixProtocol}://${matrixHomeserverBaseUrl}` }, "xyz.hippoz.waffle": { "app_url": matrixWaffleAppUrl