Skip to content

Commit

Permalink
update env var for base url
Browse files Browse the repository at this point in the history
  • Loading branch information
MattPereira committed Jan 11, 2024
1 parent 414c198 commit bfc790f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/nextjs/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
# More info: https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables
NEXT_PUBLIC_ALCHEMY_API_KEY=
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
# localhost for development, set the real URL in vercel settings through GUI or CLI
NEXT_PUBLIC_VERCEL_URL=http://localhost:3000
3 changes: 2 additions & 1 deletion packages/nextjs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ yarn-error.log*
.env.development.local
.env.test.local
.env.production.local
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
*.tsbuildinfo
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SectionContainer, SectionHeader } from "~~/components/portfolio";
const fetcher = (url: string) => fetch(url).then(res => res.json());

export function Achievements() {
const { data, error, isLoading } = useSWR(`${process.env.NEXT_PUBLIC_BASE_URL}/api/get-nfts`, fetcher);
const { data, error, isLoading } = useSWR(`${process.env.NEXT_PUBLIC_VERCEL_URL}/api/get-nfts`, fetcher);

// if (error) {
// console.error("nftsError", error);
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { MetaHeader } from "~~/components/MetaHeader";
import { About, Achievements, Experience, Landing, Projects, Skills } from "~~/components/portfolio/sections";

// export const getServerSideProps = async () => {
// const nftResponse = await fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/api/get-nfts`);
// const nftResponse = await fetch(`${process.env.NEXT_PUBLIC_VERCEL_URL}/api/get-nfts`);
// // console.log("nftResponse", nftResponse);
// const nfts = await nftResponse.json();
// // console.log("nfts", nfts);
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/pages/portfolio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const getServerSideProps: GetServerSideProps<{ wallets: WalletsData }> =
const balanceMaps: Map<string, string>[] = [];

for (const network of networks) {
const res = await fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/api/get-balances?network=${network}`);
const res = await fetch(`${process.env.NEXT_PUBLIC_VERCEL_URL}/api/get-balances?network=${network}`);
const balances = await res.json();
balanceMaps.push(new Map(balances.map((wallet: any) => [wallet.name, wallet.balance])));
}
Expand Down

1 comment on commit bfc790f

@vercel
Copy link

@vercel vercel bot commented on bfc790f Jan 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

matt-pereira – ./

matt-pereira-mattpereira.vercel.app
matt-pereira-git-main-mattpereira.vercel.app
matt-pereira.vercel.app

Please sign in to comment.