Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit a85bb60

Browse files
committed
refactor(config): use global config
1 parent a6013d4 commit a85bb60

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ const LRUCache = require('lru-cache')
1212
const helmet = require('helmet')
1313
const mobxReact = require('mobx-react')
1414
const R = require('ramda')
15-
1615
// inspect graphql model
1716
const { express: voyagerMiddleware } = require('graphql-voyager/middleware')
1817

18+
const CONFIG = require('./config/config.json')
19+
1920
const app = next({ dev, quiet: false })
2021
const handle = app.getRequestHandler()
2122
const SERVE_PORT = process.env.SERVE_PORT || 3000
@@ -48,7 +49,7 @@ app.prepare().then(() => {
4849
server.use(helmet())
4950
server.use(
5051
'/model-graphs',
51-
voyagerMiddleware({ endpointUrl: 'https://api.coderplanets.com/graphiql' })
52+
voyagerMiddleware({ endpointUrl: CONFIG.GRAPHQL_ENDPOINT })
5253
)
5354

5455
server.get('/_next/:page?', (req, res) => handle(req, res))

0 commit comments

Comments
 (0)