fix: server's root path

This commit is contained in:
ner committed 2024-10-29 08:47:08 +02:00
1 parent 1b9d979574
commit 62791957bf
2 files changed
+4 -7

No files matched your search

+3 -6
View File
@@ -1,13 +1,10 @@
import { isServer } from '@tanstack/react-query';
import { SITE_URL } from '@/env';
import Http from './Http';
const BASE =
process.env.NEXT_VERCEL_ENV === 'production'
? process.env.NEXT_VERCEL_PROJECT_PRODUCTION_URL
: process.env.NEXT_VERCEL_URL;
const ROOT = isServer ? `${BASE?.startsWith('http') ? BASE : `https://${BASE}`}` : '';
const ROOT = isServer ? `${SITE_URL?.startsWith('http') ? SITE_URL : `https://${SITE_URL}`}` : '';
const movieAdvisor = new Http(`${ROOT}/api/tmdb`);