diff --git a/apps/pwrcode-frontend/app/computer_science/algorithms/page.tsx b/apps/pwrcode-frontend/app/computer_science/algorithms/page.tsx index c89957c..5764779 100755 --- a/apps/pwrcode-frontend/app/computer_science/algorithms/page.tsx +++ b/apps/pwrcode-frontend/app/computer_science/algorithms/page.tsx @@ -7,26 +7,31 @@ import { Code } from 'bright'; // app/page.js export default async function RemoteMdxPage() { // MDX text - can be from a local file, database, CMS, fetch, anywhere... - const res = await fetch( - 'http://localhost:9000/computer-science/algorithms_and_data_structures/index.mdx', - { - headers: { - 'Content-Type': 'text/html', + try { + const res = await fetch( + `http://${process.env.NEXT_PUBLIC_FILE_API}/computer-science/algorithms_and_data_structures/index.mdx`, + { + headers: { + 'Content-Type': 'text/html', + }, }, - }, - ); - const jsonData = await res.text(); + ); - return ( - Loading...}> - - - ); + const jsonData = await res.text(); + + return ( + Loading...}> + + + ); + } catch (error) { + console.log(error); + } } diff --git a/apps/pwrcode-frontend/app/computer_science/page.tsx b/apps/pwrcode-frontend/app/computer_science/page.tsx index 02e0cd2..91fe1f4 100755 --- a/apps/pwrcode-frontend/app/computer_science/page.tsx +++ b/apps/pwrcode-frontend/app/computer_science/page.tsx @@ -7,23 +7,31 @@ import { Code } from 'bright'; // app/page.js export default async function RemoteMdxPage() { // MDX text - can be from a local file, database, CMS, fetch, anywhere... - const res = await fetch('http://localhost:9000/computer-science/index.mdx', { - headers: { - 'Content-Type': 'text/html', - }, - }); - const jsonData = await res.text(); + try { + const res = await fetch( + `http://${process.env.NEXT_PUBLIC_FILE_API}/computer-science/index.mdx`, + { + headers: { + 'Content-Type': 'text/html', + }, + }, + ); - return ( - Loading...}> - - - ); + const jsonData = await res.text(); + + return ( + Loading...}> + + + ); + } catch (error) { + console.log(error); + } }