diff options
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/apollo.js | 9 | ||||
| -rw-r--r-- | src/config/config.js | 8 | ||||
| -rw-r--r-- | src/config/env.dist | 2 |
3 files changed, 17 insertions, 2 deletions
diff --git a/src/config/apollo.js b/src/config/apollo.js new file mode 100644 index 0000000..4cfca79 --- /dev/null +++ b/src/config/apollo.js @@ -0,0 +1,9 @@ +import { ApolloClient, InMemoryCache } from '@apollo/client/core'; +import { apollo as apolloConfig } from './config'; + +const cache = new InMemoryCache(); + +export const client = new ApolloClient({ + cache, + ...apolloConfig +}); diff --git a/src/config/config.js b/src/config/config.js index 6d819a3..0570e1c 100644 --- a/src/config/config.js +++ b/src/config/config.js @@ -1,4 +1,4 @@ -import { version as packageVersion } from '../../package.json'; +import { name, version as packageVersion } from '../../package.json'; /* * The main configuration object for the Forum frontend. These values @@ -6,6 +6,12 @@ import { version as packageVersion } from '../../package.json'; * file, otherwise it won't work. */ +export const apollo = { + uri: import.meta.env.VITE_APOLLO_SERVER, + name, + version: packageVersion +}; + export const socketServer = import.meta.env.FORUM_SOCKET_SERVER; export const version = packageVersion; diff --git a/src/config/env.dist b/src/config/env.dist index 0bcd782..1f3ff0c 100644 --- a/src/config/env.dist +++ b/src/config/env.dist @@ -1 +1 @@ -FORUM_SOCKET_SERVER=ws://location_of_socket_server +VITE_APOLLO_SERVER=http://location_of_apollo_server |