fix(analytics): use rewrites instead of route handler for OpenPanel proxy
Some checks failed
Build and Deploy / build (push) Has been cancelled

This commit is contained in:
Unchained
2026-03-31 06:37:17 +02:00
parent 1dd7e1dfe7
commit 1cdda7db3c
2 changed files with 9 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ const nextConfig: NextConfig = {
output: 'standalone',
async rewrites() {
const rybbitHost = process.env.NEXT_PUBLIC_RYBBIT_HOST || "https://rybbit.nodecrew.me";
const openpanelUrl = process.env.OPENPANEL_API_URL || "https://op.nodecrew.me/api";
return [
{
source: "/api/script.js",
@@ -28,6 +29,14 @@ const nextConfig: NextConfig = {
source: "/api/session-replay/record/:id",
destination: `${rybbitHost}/api/session-replay/record/:id`,
},
{
source: "/api/op/track",
destination: `${openpanelUrl}/track`,
},
{
source: "/api/op/op1.js",
destination: `${openpanelUrl}/op1.js`,
},
];
},
images: {