Disable jsreport web UI but still allow API requests with authentication
-
Is there a way to completely disable the jsreport web UI in its entirety, but still allow report requests with authentication?
I have the settings below applied which does disable both the login and studio UI but when I try making a report request from another node app, I get the error
ERR_CONNECTION_REFUSED
. My goal is to be able to make report requests with authentication but I do not need the web interface at all. I'm deploying this as a node app using jsreport 2.11.0 and I cannot upgrade this version."extensions": { "authentication": { "cookieSession": { "secret": "..." }, "admin": { "username": "username", "password": "pw" }, "enabled": true }, "scripts": { "strategy": "http-server" }, "studio": { "enabled": false }, "express": { "enabled": false } }
When I set
express.enabled: true
andstudio.enabled: false
, the requests work but I still have the login UI available, which I don't want (but I still want the requests with authentication). Not sure if this is possible or maybe I'm missing something, but I would appreciate any help. Thanks in advance.
-
This is the right config,
express.enabled: true, studio.enabled: false
However, in v2 there is still login screen wired, you would need to update jsreport.Or you can overwrite the route in your
server.js
fileconst jsreport = require('jsreport')() if (process.env.JSREPORT_CLI) { // export jsreport instance to make it possible to use jsreport-cli module.exports = jsreport } else { jsreport.init().then(() => { reporter.on('after-express-static-configure', (app) => { app.get('/', (req, res) => { res.status(404).send('Not Found') }) }) // running }).catch((e) => { // error during startup console.error(e.stack) process.exit(1) }) }