fix(analytics): use rewrites instead of route handler for OpenPanel proxy
Some checks failed
Build and Deploy / build (push) Has been cancelled
Some checks failed
Build and Deploy / build (push) Has been cancelled
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import { createRouteHandler } from "@openpanel/nextjs/server";
|
||||
|
||||
export const { GET, POST } = createRouteHandler({
|
||||
apiUrl: process.env.OPENPANEL_API_URL || "https://op.nodecrew.me/api",
|
||||
});
|
||||
Reference in New Issue
Block a user