Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const app = express();
app.use(cookieParser());
const server = new ApolloServer({
schema: resolvedSchema,
playground: {
settings: {
'request.credentials': 'same-origin',
},
},
context: context => extendContext({ ...context, config: hopsConfig }),
});
server.applyMiddleware({
app,
path: hopsConfig.graphqlMockServerPath,
cors: {
credentials: true,
origin: true,
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
allowedHeaders: 'content-type',
},
});
return app;
});
const app = express();
app.use(cookieParser());
const server = new ApolloServer({
schema: resolvedSchema,
playground: {
settings: {
'request.credentials': 'same-origin',
},
},
context: context => ({ ...context, config: hopsConfig }),
});
server.applyMiddleware({
app,
path: hopsConfig.graphqlMockServerPath,
cors: {
credentials: true,
origin: true,
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
allowedHeaders: 'content-type',
},
});
return app;
});