Skip to content

Commit

Permalink
Set env var for bgapp api
Browse files Browse the repository at this point in the history
  • Loading branch information
Pabl0cks committed Sep 20, 2024
1 parent eeb57d7 commit e194ce6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/nextjs/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
# More info: https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables
NEXT_PUBLIC_ALCHEMY_API_KEY=
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
BGAPP_API_URL=
8 changes: 7 additions & 1 deletion packages/nextjs/pages/extensions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { ExtensionCard } from "~~/components/ExtensionCard";
import { MetaHeader } from "~~/components/MetaHeader";
import curatedExtensions from "~~/public/extensions.json";

const BGAPP_API_URL = process.env.BGAPP_API_URL;

type Extension = {
name: string;
description: string;
Expand Down Expand Up @@ -99,7 +101,11 @@ const ExtensionsList: NextPage<ExtensionsListProps> = ({ thirdPartyExtensions })
// get third party extensions from buidlguidl app (builds with "extension" type)
export const getStaticProps: GetStaticProps<ExtensionsListProps> = async () => {
try {
const response = await fetch("https://buidlguidl-v3.ew.r.appspot.com/builds?type=extension");
if (!BGAPP_API_URL) {
throw new Error("BGAPP_API_URL environment variable is not set");
}

const response = await fetch(`${BGAPP_API_URL}/builds?type=extension`);
const data = await response.json();
const formattedExtensions = data.map((ext: any) => {
const githubUrlParts = ext.branch.split("/");
Expand Down

0 comments on commit e194ce6

Please sign in to comment.