chore(gql/catalog): fixing some code review comments

This commit is contained in:
blam
2020-08-14 14:37:17 +02:00
parent a09e949b6f
commit 9b3236f47e
4 changed files with 13 additions and 82 deletions
+10 -7
View File
@@ -51,19 +51,22 @@ export async function createRouter(
const server = new ApolloServer({
schema,
logger: options.logger,
introspection: true,
playground: process.env.NODE_ENV === 'development',
});
const router = Router();
const apolloMiddlware = server.getMiddleware({ path: '/' });
router.use(
helmet.contentSecurityPolicy({
directives: {
defaultSrc: ["'self'", "'unsafe-inline'", 'http://*'],
},
}),
);
if (process.env.NODE_ENV === 'development')
router.use(
helmet.contentSecurityPolicy({
directives: {
defaultSrc: ["'self'", "'unsafe-inline'", 'http://*'],
},
}),
);
router.use(apolloMiddlware);