mirror of
https://github.com/langgenius/dify.git
synced 2026-07-21 12:05:30 -04:00
1b37635f92
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
13 lines
466 B
TypeScript
13 lines
466 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.
|
|
const serverConsoleApiUrl = env.SERVER_CONSOLE_API_URL || env.CONSOLE_API_URL
|
|
|
|
export const SERVER_CONSOLE_API_PREFIX = serverConsoleApiUrl
|
|
? `${withoutTrailingSlash(serverConsoleApiUrl)}/console/api`
|
|
: undefined
|