diff --git a/apps/main/src/pages/settings.tsx b/apps/main/src/pages/settings.tsx
index 3c9d07c..cb2b93c 100644
--- a/apps/main/src/pages/settings.tsx
+++ b/apps/main/src/pages/settings.tsx
@@ -420,7 +420,7 @@ export default function SettingsPage() {
{organizationData?.organization?.logo_url ? (

diff --git a/apps/main/worker/index.test.ts b/apps/main/worker/index.test.ts
index 1eebd61..8ee2184 100644
--- a/apps/main/worker/index.test.ts
+++ b/apps/main/worker/index.test.ts
@@ -26,17 +26,12 @@ describe("buildManifest", () => {
expect(manifest.icons[0].src).toBe("/pwa-icons/pwa-192x192.png");
});
- it("returns org-specific icon URLs when orgId is provided", () => {
- const manifest = buildManifest(42, "https://api.example.com");
+ it("returns org-specific icon URLs from assets.xtablo.com when orgId is provided", () => {
+ const manifest = buildManifest(42);
expect(manifest.name).toBe("XTablo");
- expect(manifest.icons[0].src).toBe("https://api.example.com/api/v1/public/org-icons/42/icon-192.png");
- expect(manifest.icons[1].src).toBe("https://api.example.com/api/v1/public/org-icons/42/icon-512.png");
- expect(manifest.icons[2].src).toBe("https://api.example.com/api/v1/public/org-icons/42/icon-512-maskable.png");
+ expect(manifest.icons[0].src).toBe("https://assets.xtablo.com/org-icons/42/icon-192.png");
+ expect(manifest.icons[1].src).toBe("https://assets.xtablo.com/org-icons/42/icon-512.png");
+ expect(manifest.icons[2].src).toBe("https://assets.xtablo.com/org-icons/42/icon-512-maskable.png");
expect(manifest.icons[2].purpose).toBe("maskable");
});
-
- it("uses empty string as apiUrl fallback", () => {
- const manifest = buildManifest(42);
- expect(manifest.icons[0].src).toBe("/api/v1/public/org-icons/42/icon-192.png");
- });
});
diff --git a/apps/main/worker/index.ts b/apps/main/worker/index.ts
index 32ccf0d..57eca2d 100644
--- a/apps/main/worker/index.ts
+++ b/apps/main/worker/index.ts
@@ -25,7 +25,9 @@ interface WebAppManifest {
icons: ManifestIcon[];
}
-export function buildManifest(orgId: number | null, apiUrl = ""): WebAppManifest {
+const ASSETS_BASE_URL = "https://assets.xtablo.com";
+
+export function buildManifest(orgId: number | null): WebAppManifest {
const base = {
name: "XTablo",
short_name: "XTablo",
@@ -41,9 +43,9 @@ export function buildManifest(orgId: number | null, apiUrl = ""): WebAppManifest
return {
...base,
icons: [
- { src: `${apiUrl}/api/v1/public/org-icons/${orgId}/icon-192.png`, sizes: "192x192", type: "image/png" },
- { src: `${apiUrl}/api/v1/public/org-icons/${orgId}/icon-512.png`, sizes: "512x512", type: "image/png" },
- { src: `${apiUrl}/api/v1/public/org-icons/${orgId}/icon-512-maskable.png`, sizes: "512x512", type: "image/png", purpose: "maskable" },
+ { src: `${ASSETS_BASE_URL}/org-icons/${orgId}/icon-192.png`, sizes: "192x192", type: "image/png" },
+ { src: `${ASSETS_BASE_URL}/org-icons/${orgId}/icon-512.png`, sizes: "512x512", type: "image/png" },
+ { src: `${ASSETS_BASE_URL}/org-icons/${orgId}/icon-512-maskable.png`, sizes: "512x512", type: "image/png", purpose: "maskable" },
],
};
}
@@ -58,18 +60,14 @@ export function buildManifest(orgId: number | null, apiUrl = ""): WebAppManifest
};
}
-interface Env {
- API_URL?: string;
-}
-
export default {
- fetch(request: Request, env: Env) {
+ fetch(request: Request) {
const url = new URL(request.url);
if (url.pathname === "/manifest.webmanifest") {
const cookieHeader = request.headers.get("cookie");
const orgId = parseOrgIdFromCookie(cookieHeader);
- const manifest = buildManifest(orgId, env.API_URL || "");
+ const manifest = buildManifest(orgId);
return new Response(JSON.stringify(manifest), {
headers: {
diff --git a/apps/main/wrangler.toml b/apps/main/wrangler.toml
index b56b580..47c3ef1 100644
--- a/apps/main/wrangler.toml
+++ b/apps/main/wrangler.toml
@@ -15,11 +15,5 @@ PYTHON_VERSION = "3.11.5"
[env.production]
route = { pattern = "app.xtablo.com", custom_domain = true }
-[env.production.vars]
-API_URL = "https://xablo-api-636270553187.europe-west1.run.app"
-
[env.staging]
-route = { pattern = "app-staging.xtablo.com", custom_domain = true }
-
-[env.staging.vars]
-API_URL = "https://xablo-api-staging-636270553187.europe-west1.run.app"
\ No newline at end of file
+route = { pattern = "app-staging.xtablo.com", custom_domain = true }
\ No newline at end of file