Skip to content

Commit 21a8e35

Browse files
authored
Merge pull request #21 from demokratie-live/sprint#6/apollo_optional
made apollo engine optional
2 parents 96c6a2e + a1b1082 commit 21a8e35

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ const schema = makeExecutableSchema({
2424
resolvers,
2525
});
2626

27-
const engine = new Engine({
28-
engineConfig: { apiKey: process.env.ENGINE_API_KEY },
29-
graphqlPort: constants.PORT,
30-
});
31-
engine.start();
32-
app.use(engine.expressMiddleware());
27+
if (process.env.ENGINE_API_KEY) {
28+
const engine = new Engine({
29+
engineConfig: { apiKey: process.env.ENGINE_API_KEY },
30+
graphqlPort: constants.PORT,
31+
});
32+
engine.start();
33+
app.use(engine.expressMiddleware());
34+
}
3335

3436
app.use(bodyParser.json());
3537

0 commit comments

Comments
 (0)