Files
dify/web/config/server.ts
2026-05-29 18:52:36 +08:00

11 lines
387 B
TypeScript

import { env } from '@/env'
import 'server-only'
const withoutTrailingSlash = (value: string) => value.endsWith('/') ? value.slice(0, -1) : value
// Server-side requests need the origin; browser requests should keep using NEXT_PUBLIC_API_PREFIX.
export const SERVER_CONSOLE_API_PREFIX = env.CONSOLE_API_URL
? `${withoutTrailingSlash(env.CONSOLE_API_URL)}/console/api`
: undefined