exporess app vs jsreport prod.config.json
-
I've got a small express app which is basically similiar to the one I've found here https://jsreport.net/learn/adapting-jsreport#attach-to-existing-express-app
I would like to know whether my prod.config.json configuration works the same way as it was used by standalone jsreport app? To be more precisely I mean tasks, and phantom strategy, numerOfWorkers - are they going to work as it supposed to or do I have to handle it somehow on my own?
Maybe it'a a dumb question but it's my first nodejs app and I'm a little bit confused.
"phantom": { "strategy": "phantom-server", "numberOfWorkers": 2, "timeout": 60000, "defaultPhantomjsVersion": "2.1.1" }, "tasks": { "strategy": "in-process", "timeout": 10000, "numberOfWorkers": 2, "allowedModules": [] }
-
hi! yes, it should work the same if you are not changing the
rootDirectoryconfig when creating the jsreport instance in your code. to know what config file jsreport is picking just check the logs in your console when starting the app, you should see a line like the followingInitializing jsreport@1.9.1 in development mode using configuration file: dev.config.jsonbe aware that jsreport will only pick the
prod.config.jsonfile if your app is started withNODE_ENDenv var set toproduction
-
Just adding my 2 cents here.
The new configuration documentation covers the file usage quite well. Take a look.
You should also be able to see what strategy (dedicated-process vs phantom-server) is being used in the output logs.+476 Executing recipe phantom-pdf +4096 Converting in http server based phantomjs 1.9.8