Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

358
Views
¿Cómo habilitar csrf en node express para graphql y graphiql con, por ejemplo, lusca?

Tengo un servidor node express con csrf lusca y quiero habilitar csrf también para graphql y graphiql, pero ¿cómo hacerlo?

 const csrf = require('lusca').csrf() const graphqlExpress = require('graphql-server-express').graphqlExpress const graphiqlExpress = require('graphql-server-express').graphiqlExpress server.use((req, res, next) => { csrf(req, res, next) } }) server.use('/graphql', (req, res, next) => { graphqlExpress( () => { const query = req.query.query || req.body.query; return { schema, context: Object.assign({ user }, req.context), debug: false, formatError(e) { console.log(e) }, } })(req, res, next) }) server.use('/graphiql', graphiqlExpress({ endpointURL: '/graphql', }))
about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!