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

This commit is contained in:
blam
2020-08-14 14:37:17 +02:00
committed by Fredrik Adelöw
parent 88269ecd23
commit 72d8f54913
3 changed files with 13 additions and 11 deletions
+1 -2
View File
@@ -44,7 +44,6 @@
"supertest": "^4.0.2"
},
"files": [
"dist",
"schema.gql"
"dist"
]
}
+2 -2
View File
@@ -24,8 +24,8 @@
"@backstage/plugin-catalog-graphql": "^0.1.1-alpha.18",
"@graphql-modules/core": "^0.7.17",
"@types/express": "^4.17.6",
"apollo-server": "^2.16.0",
"apollo-server-express": "^2.16.0",
"apollo-server": "^2.16.1",
"apollo-server-express": "^2.16.1",
"express": "^4.17.1",
"express-promise-router": "^3.0.3",
"graphql": "^15.3.0",
+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);