disabling play ground



  • When setting
    "studio": {
    "enabled": false
    },
    can not get any report. logs are being generated so can not debug what going on. how can I have a home page that does not point to playground or studio. the jsreport servers sit behind the proxy and share same domain name.


  • administrators

    can not get any report

    what do you mean by this? do you mean that you are not able to call jsreport http API and get normal result?

    logs are being generated so can not debug what going on

    still confused about this sentence.. you should be able to see the logs in the console that you use to start jsreport, if there is some error it shoulb be there too, no need for studio to see the logs.

    how can I have a home page that does not point to playground or studio. the jsreport servers sit behind the proxy and share same domain name

    when you disable studio there won't be any homepage available and you can only talk with jsreport through http requests, if you want to add a custom homepage with studio disabled, you will need to create a custom extension that registers that, somehting similar to what studio does. you can put in the custom extension something like this:

    reporter.on('after-authentication-express-routes', () => reporter.express.app.get('/', sendIndex))
    
      reporter.on('after-express-static-configure', () => {
        if (!reporter.authentication) {
          return reporter.express.app.get('/', sendIndex)
        }
      })
    
    function sendIndex (req, res, next) {
      res.send('<h1>My custom home page</h1>')   
    }
    


  • Thanks for the reply. I meant to say : logs were not being generated so can not debug what going on.Have been struggling with the config for while, finally figure it out. It was some kind of line ending that messed up config file when I copy pasted the snippet. I reverted back to original config and typed the code and it worked. I will try the last part of replacing studio with custom home page.


Log in to reply
 

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