Skip to content

Commit

Permalink
Allow customizing mastodon server url via env var
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Weiner committed Nov 13, 2024
1 parent 60dc214 commit 02aac8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/routers/meteApiUsersRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ 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,
});
}

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;
}
Expand Down

0 comments on commit 02aac8f

Please sign in to comment.