diff --git a/apps/main/vercel.json b/apps/main/vercel.json deleted file mode 100644 index aa9ecb9..0000000 --- a/apps/main/vercel.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$schema": "https://openapi.vercel.sh/vercel.json", - "rewrites": [ - { - "source": "/stats/:match*", - "destination": "https://analytics.umami.is/:match*" - } - ] -} diff --git a/apps/main/vite.config.ts b/apps/main/vite.config.ts index df33534..7c5becc 100644 --- a/apps/main/vite.config.ts +++ b/apps/main/vite.config.ts @@ -11,5 +11,15 @@ export default defineConfig({ }, server: { open: true, + proxy: { + // https://umami.is/docs/guides/bypass-ad-blockers + // https://vitejs.dev/config/server-options.html#server-proxy + // https://developomp.com/stats/* -> https://analytics.umami.is/* + "^/stats/.*": { + target: "https://analytics.umami.is/", + changeOrigin: true, + rewrite: (path) => path.slice(6), // slice "/stats" off the string (which is 6 characters long) + }, + }, }, })