app.use(xss());//safety against XSS attack or Cross Site Scripting attacks
app.use(helmet());
httpServer.listen(process.env.PORT || 4000, () => {
console.log(
`🚀 Server ready at http://localhost:${process.env.PORT || 4000}${
server.graphqlPath
`🚀 Server ready at http://localhost:${process.env.PORT || 4000}${server.graphqlPath
}`
);
console.log(
`🚀 Subscriptions ready at ws://localhost:${process.env.PORT || 4000}${
server.subscriptionsPath
}`
);
});
I am using graphQL and helmet at the same time. I think which is stopping my graphQL api playground. THIS MY CODE I CANT RESOLVE PLS HELP. enter image description here
hey shresth try using this in your program
app.use(helmet({ contentSecurityPolicy: (process.env.NODE_ENV === 'production') ? undefined : false }));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With