File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { AUTH_PATH } from "@polinetwork/backend"
12import type { NextRequest } from "next/server"
23import { NextResponse } from "next/server"
34import { env } from "./env"
45
56export const config = {
6- matcher : [ "/api/ :path*" ] ,
7+ matcher : [ ` ${ AUTH_PATH } / :path*` ] ,
78}
89
910export function middleware ( request : NextRequest ) {
10- if ( request . nextUrl . pathname . startsWith ( "/api" ) ) {
11+ if ( request . nextUrl . pathname . startsWith ( AUTH_PATH ) ) {
1112 return NextResponse . rewrite ( new URL ( request . nextUrl . pathname + request . nextUrl . search , env . BACKEND_URL ) )
1213 }
1314}
Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ import "server-only"
33import { type AppRouter , TRPC_PATH } from "@polinetwork/backend"
44import { createTRPCClient , httpBatchLink } from "@trpc/client"
55import SuperJSON from "superjson"
6- import { getBaseUrl } from "../../lib/utils "
6+ import { env } from "@/env "
77
8- const url = getBaseUrl ( ) + TRPC_PATH
8+ const url = env . BACKEND_URL + TRPC_PATH
99export const trpc = createTRPCClient < AppRouter > ( {
1010 links : [
1111 httpBatchLink ( {
You can’t perform that action at this time.
0 commit comments