ファイル
btrc-hub/frontend/src/lib/renderContext.ts
T
2026-10-20 20:44:14 +09:00

19 行
548 B
TypeScript

export type RenderContext = {
pathname: string
origin: string
apiBaseURL?: string
cookie?: string
setCookies?: string[]
csrf?: { token?: string; pending?: Promise<string> }
forwardedFor?: string
status?: number }
// The server build replaces this module with the AsyncLocalStorage implementation.
export const currentRenderContext = (): RenderContext | undefined => {
if (typeof window === 'undefined')
return undefined
return { pathname: window.location.pathname,
origin: window.location.origin }
}