wealth/apps/bear/src/proxy.ts

18 lines
658 B
TypeScript

import { refreshSessionInProxy } from '@lumina/market/server';
import type { NextRequest } from 'next/server';
import { API_VERSION_PATH } from './constants';
import { serverEnv } from './env/server';
/** Refreshes an expired session before the page renders (see refreshSessionInProxy). */
export function proxy(request: NextRequest) {
return refreshSessionInProxy(request, {
apiUrl: `${serverEnv.API_INTERNAL_ORIGIN}${API_VERSION_PATH}`,
});
}
export const config = {
// Pages and their data requests only: not build assets, images or files with an extension.
matcher: ['/((?!_next/static|_next/image|favicon.ico|.*\\.[a-zA-Z0-9]+$).*)'],
};