Skip to content

Commit

Permalink
feat: differentiate API URL based on NODE_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
amalv committed Dec 13, 2023
1 parent b267db7 commit a4334b7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/apolloClient.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { ApolloClient, InMemoryCache } from "@apollo/client";

const isProduction = process.env.NODE_ENV === "production";
const API_URL = isProduction
? "https://fhdqwwo1yj.execute-api.us-east-1.amazonaws.com/"
: "http://localhost:3000";

export const client = new ApolloClient({
uri: "http://localhost:3000",
uri: API_URL,
cache: new InMemoryCache(),
});

0 comments on commit a4334b7

Please sign in to comment.