diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-03-13 15:28:29 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-03-13 15:28:29 +0100 |
| commit | c1bc5993a694f6fd047a3881351827058042483b (patch) | |
| tree | 3d64130e1e6a2f86f70981df28cf22cd535bf2b2 /src/config | |
| parent | bd8e98d7e24c4dbaee7db6ec7955f7c2f6d396a6 (diff) | |
Use routify and GraphQL server
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 |