mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-22 08:38:13 +02:00
fix: use runtime BACKEND_URL for proxying (#411)
* fix: use runtime BACKEND_URL for proxying Fixes #400 * chore: run formatter
This commit is contained in:
parent
acc2ef9e96
commit
cdb27c1d4f
6 changed files with 130 additions and 17 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import type { NextRequest } from 'next/server';
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
import { getServerBackendUrl } from '@/lib/apiClient';
|
||||
|
||||
const OSS_TOKEN_COOKIE = 'dograh_auth_token';
|
||||
|
||||
// Paths that don't require authentication in OSS mode
|
||||
|
|
@ -14,7 +16,7 @@ async function fetchAuthProvider(): Promise<string> {
|
|||
}
|
||||
|
||||
try {
|
||||
const backendUrl = process.env.BACKEND_URL || 'http://localhost:8000';
|
||||
const backendUrl = getServerBackendUrl();
|
||||
const res = await fetch(`${backendUrl}/api/v1/health`);
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue