chore: add app config with GQL URL and PORT 3001
This commit is contained in:
2
packages/web/.env-example
Normal file
2
packages/web/.env-example
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
PORT=3001
|
||||||
|
REACT_APP_GRAPHQL_URL=http://localhost:3000/graphql
|
9
packages/web/src/config/app.ts
Normal file
9
packages/web/src/config/app.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
type Config = {
|
||||||
|
[key: string]: string,
|
||||||
|
};
|
||||||
|
|
||||||
|
const config: Config = {
|
||||||
|
graphqlUrl: process.env.REACT_APP_GRAPHQL_URL as string,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
@@ -1,6 +1,10 @@
|
|||||||
import { ApolloClient, InMemoryCache } from '@apollo/client';
|
import { ApolloClient, InMemoryCache } from '@apollo/client';
|
||||||
|
import appConfig from 'config/app';
|
||||||
|
|
||||||
const cache = new InMemoryCache();
|
const cache = new InMemoryCache();
|
||||||
const client = new ApolloClient({ cache: cache });
|
const client = new ApolloClient({
|
||||||
|
uri: appConfig.graphqlUrl,
|
||||||
|
cache
|
||||||
|
});
|
||||||
|
|
||||||
export default client;
|
export default client;
|
||||||
|
Reference in New Issue
Block a user