diff --git a/README.md b/README.md index 7eaccc2..f976dfa 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,8 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the 4. Open a terminal and navigate to the folder your fly.toml is in. Run `fly launch` 5. Set your fly secrets: `fly secrets set ALBYHUB_URL="your-albyhub-url.example.com" AUTH_TOKEN="eyJhbGciOiJIUzI1NiIsInR5c....RvM" BASE_URL="https://YOURAPPNAME.fly.dev"`. +> `BASE_URL` is the URL where you will host your Jim app. + > If you use Alby Cloud, you also need to set `ALBYHUB_NAME="YOUR_ALBYHUB_NAME"` to route requests to your specific hub. > You can get the ALBYHUB_URL, AUTH_TOKEN and ALBYHUB_NAME by logging into Alby Hub and Going to settings -> Developer. diff --git a/app/actions.ts b/app/actions.ts index 9cc24df..b33538b 100644 --- a/app/actions.ts +++ b/app/actions.ts @@ -190,7 +190,7 @@ export async function getInfo() { function getHeaders() { return { Authorization: `Bearer ${process.env.AUTH_TOKEN}`, - "AlbyHub-Name": process.env.ALBYHUB_NAME || "", + "AlbyHub-Name": process.env.ALBYHUB_NAME || process.env.ALBY_HUB_NAME || "", "Content-Type": "application/json", Accept: "application/json", }; diff --git a/app/utils.ts b/app/utils.ts index 66c28ec..6d83b6b 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -1,8 +1,9 @@ export function getAlbyHubUrl() { - if (!process.env.ALBYHUB_URL) { - throw new Error("No BASE_URL set"); + const albyHubUrl = process.env.ALBYHUB_URL || process.env.ALBY_HUB_URL; + if (!albyHubUrl) { + throw new Error("No ALBYHUB_URL set"); } - return removeTrailingSlash(process.env.ALBYHUB_URL); + return removeTrailingSlash(albyHubUrl); } export function getBaseUrl() {