refactoring: server actions => tmdb proxy
This commit is contained in:
1 parent
dfdfb79169
commit
97d55b24a1
13 files changed
+131
-113
No files matched your search
@@ -1,10 +1,14 @@
|
||||
import { isServer } from '@tanstack/react-query';
|
||||
|
||||
import Http from './Http';
|
||||
|
||||
const BASE =
|
||||
process.env.NEXT_PUBLIC_VERCEL_ENV === 'production'
|
||||
? process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL
|
||||
: process.env.NEXT_PUBLIC_VERCEL_URL;
|
||||
process.env.NEXT_VERCEL_ENV === 'production'
|
||||
? process.env.NEXT_VERCEL_PROJECT_PRODUCTION_URL
|
||||
: process.env.NEXT_VERCEL_URL;
|
||||
|
||||
const movieAdvisor = new Http(`${BASE?.startsWith('http') ? BASE : `https://${BASE}`}/api/tmdb`);
|
||||
const ROOT = isServer ? `${BASE?.startsWith('http') ? BASE : `https://${BASE}`}` : '';
|
||||
|
||||
const movieAdvisor = new Http(`${ROOT}/api/tmdb`);
|
||||
|
||||
export default movieAdvisor;
|
||||
Reference in new issue
Block a user