Call encrypt: How to use express middleware



  • When using the API route Im expecting to get the a valid request but the json will be encrypted.
    I cannot use beforeRender or decode the json, i need to use an express middleware.
    Can you please provide some guide for this ? TY
    @bjrmatos @jan_blaha



  • Do you mean you send the request body in some encrypted form?



  • Yes ,
    The json body is encrypted, for that i cannot use beforeRender.
    first action is to decrypt the req.body and then start ..



  • In your app launching file server.js, add the following

    const jsreport = require('jsreport')()
    
    jsreport.on('before-express-configure', () => {
      jsreport.express.app.use('/api/report', (req, res, next) => {
        console.log('do what you want with req')
        next()
      })
    })
    

Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.