From 02aac8f8e9dc4096560042546607269a0173e25f Mon Sep 17 00:00:00 2001 From: Marcus Weiner Date: Wed, 13 Nov 2024 22:02:28 +0100 Subject: [PATCH] Allow customizing mastodon server url via env var --- src/routers/meteApiUsersRouter.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routers/meteApiUsersRouter.ts b/src/routers/meteApiUsersRouter.ts index a2ff77b..0b8b85d 100644 --- a/src/routers/meteApiUsersRouter.ts +++ b/src/routers/meteApiUsersRouter.ts @@ -13,9 +13,9 @@ if (meteBaseUrl.endsWith("/")) { } let masto; -if (process.env.MASTODON_ACCESS_TOKEN) { +if (process.env.MASTODON_SERVER_URL && process.env.MASTODON_ACCESS_TOKEN) { masto = createRestAPIClient({ - url: "https://botsin.space", + url: process.env.MASTODON_SERVER_URL, accessToken: process.env.MASTODON_ACCESS_TOKEN, }); } @@ -23,7 +23,7 @@ if (process.env.MASTODON_ACCESS_TOKEN) { const postDrinkToMastodon = async (drinkId: number) => { if (!masto) { console.warn( - "Not posting to mastodon because MASTODON_ACCESS_TOKEN not set" + "Not posting to mastodon because MASTODON_SERVER_URL or MASTODON_ACCESS_TOKEN not set" ); return; }