diff --git a/src/pages/dex/trading/find-pair/index.tsx b/src/pages/dex/trading/find-pair/index.tsx index cd3249a..24f94cf 100644 --- a/src/pages/dex/trading/find-pair/index.tsx +++ b/src/pages/dex/trading/find-pair/index.tsx @@ -3,6 +3,8 @@ import { GetServerSideProps } from 'next'; import { findPairID } from '@/utils/methods'; import styles from '@/styles/404.module.scss'; +const API_URL = process.env.NEXT_PUBLIC_API_URL; + export const getServerSideProps: GetServerSideProps = async (context) => { const { first, second } = context.query; @@ -13,11 +15,7 @@ export const getServerSideProps: GetServerSideProps = async (context) => { } try { - const idFound = await findPairID( - first as string, - second as string, - context.req.headers.host as string, - ); + const idFound = await findPairID(first as string, second as string, API_URL); console.log('ID found:', idFound); diff --git a/src/utils/methods.ts b/src/utils/methods.ts index 89d6a41..5e86cfb 100644 --- a/src/utils/methods.ts +++ b/src/utils/methods.ts @@ -81,7 +81,7 @@ export async function findPairID( second: string, host: string | undefined = undefined, ): Promise { - const findPairURL = `${host ? `https://${host}` : ''}/api/dex/find-pair`; + const findPairURL = `${host ?? ''}/api/dex/find-pair`; console.log('Find pair URL:', findPairURL);