Skip to content

Commit

Permalink
fix: setup correct baseURI
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Mar 28, 2024
1 parent 9bc1f5f commit 13e13eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions _config/nodeAPI/app/api/chain/[chainID]/[filename]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ export async function GET(request: Request, context: TContext): Promise<Response
return await resolveNotFound(request);
}

const baseURI = process.env.NEXT_PUBLIC_VERCEL_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
: (request as any)?.nextUrl?.origin;
const result = await fetch(`${baseURI}/chains/${chainIDStr}/${fileName}`);
const baseURI = 'https://raw.githubusercontent.com/SmolDapp/tokenAssets/main';
const finalURI = (`${baseURI}/chains/${chainIDStr}/${fileName}`).toLowerCase();
const result = await fetch(finalURI);
if (result.ok) {
if (fileName.endsWith('.svg')) {
return new Response(result.body, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ export async function GET(request: Request, context: TContext): Promise<Response
return await resolveNotFound(request);
}

const baseURI = process.env.NEXT_PUBLIC_VERCEL_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
: (request as any)?.nextUrl?.origin;
const result = await fetch(`${baseURI}/tokens/${chainIDStr}/${tokenAddress}/${fileName}`);
const baseURI = 'https://raw.githubusercontent.com/SmolDapp/tokenAssets/main';
const finalURI = (`${baseURI}/tokens/${chainIDStr}/${tokenAddress}/${fileName}`).toLowerCase();
const result = await fetch(finalURI);
if (result.ok) {
if (fileName.endsWith('.svg')) {
return new Response(result.body, {
Expand Down

0 comments on commit 13e13eb

Please sign in to comment.