-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
67 lines (64 loc) · 1.89 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
require('dotenv').config()
const { ApolloEngineLauncher } = require('apollo-engine')
// Define the Engine configuration.
const launcher = new ApolloEngineLauncher({
apiKey: process.env.APOLLO_KEY,
origins: [
{
http: {
/* url: 'http://localhost:4001/graphiql', */
/* url: 'http://localhost:7001/graphiql', */
/* url: 'http://apiraw.coderplanets.com/graphiql', */
url: process.env.APOLLO_ORIGIN,
overrideRequestHeaders: {
/* origin: '*', */
/* 'access-control-allow-origin': '*', */
/* Host: 'apiraw.coderplanets.com', */
Host: process.env.APOLLO_ORIGIN.split('//')[1],
/* 'content-type': 'application/json;charset=utf-8', */
/* Origin: 'http://localhost:3000',*/
/* special: 'Special header value', */
/* authorization: 'Bearer autk',*/
},
},
},
],
logging: {
/* level: 'INFO', */
/* level: 'ERROR', */
/* level: 'DEBUG', */
/* level: 'INFO', */
level: 'ERROR',
},
frontends: [
{
/* parse evn-var issue */
/* host: process.env.APOLLO_FRONT_HOST, */
/* host: 'http://devapi.coderplanets.com', */
/* port: parseInt(process.env.APOLLO_FRONT_PORT.slice(1, -1)), */
/* port: parseInt(process.env.APOLLO_FRONT_PORT), */
/* host: 'devapiraw.coderplanets.com', */
port: parseInt(process.env.APOLLO_FRONT_PORT),
endpoints: ['/graphiql'],
/* overrideGraphqlResponseHeaders: { */
/* 'Access-Control-Allow-Origin': '*', */
/* special: 'Special header value', */
/* }, */
},
],
stores: [
{
name: 'inMemEmbeddedCache',
inMemory: {
cacheSize: 104857600, // 100 MB; defaults to 50MB.
},
},
],
queryCache: {
publicFullQueryStore: 'inMemEmbeddedCache',
},
})
// Start the Proxy; crash on errors.
launcher.start().catch(err => {
throw err
})