Skip to content

Commit

Permalink
add : NEXT_PUBLIC_APP_ENV in .env.example
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhi1992002 committed Nov 9, 2024
1 parent 0b5b95e commit 8cd91c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion autogpt_platform/frontend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ NEXT_PUBLIC_AUTH_CALLBACK_URL=http://localhost:8006/auth/callback
NEXT_PUBLIC_AGPT_SERVER_URL=http://localhost:8006/api
NEXT_PUBLIC_AGPT_WS_SERVER_URL=ws://localhost:8001/ws
NEXT_PUBLIC_AGPT_MARKETPLACE_URL=http://localhost:8015/api/v1/market
NEXT_PUBLIC_APP_ENV=dev

## Supabase credentials

Expand All @@ -15,4 +16,4 @@ AUTH_CALLBACK_URL=http://localhost:3000/auth/callback
GA_MEASUREMENT_ID=G-FH2XK2W4GN

# When running locally, set NEXT_PUBLIC_BEHAVE_AS=CLOUD to use the a locally hosted marketplace (as is typical in development, and the cloud deployment), otherwise set it to LOCAL to have the marketplace open in a new tab
NEXT_PUBLIC_BEHAVE_AS=LOCAL
NEXT_PUBLIC_BEHAVE_AS=LOCAL
10 changes: 9 additions & 1 deletion autogpt_platform/frontend/src/components/nav/MarketPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ interface MarketPopupProps extends ButtonHTMLAttributes<HTMLButtonElement> {

export default function MarketPopup({
className = "",
marketplaceUrl = "http://platform.agpt.co/marketplace",
marketplaceUrl = (() => {
if (process.env.NEXT_PUBLIC_APP_ENV === "prod") {
return "https://production-marketplace-url.com";
} else if (process.env.NEXT_PUBLIC_APP_ENV === "dev") {
return "https://dev-builder.agpt.co/marketplace";
} else {
return "http://localhost:3000/marketplace";
}
})(),
children,
...props
}: MarketPopupProps) {
Expand Down

0 comments on commit 8cd91c9

Please sign in to comment.