I packaged my electron app. When I start my electron app, I want my MongoDB service to start automatically on the system installed locally. How can I achieve this through my node code?
hope this help you.
spawn = require("child_process").spawn,
mongo_server = spawn("mongod.exe", ["c:/mongo_path"], { cwd: process.cwd() })
If you installed MongoDB with agt-get (or ony similar manager), probably it will start automatically on systems boot. I haven used electron, but if it is possible to use node modules, you can do child_process.exec on your project startup.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With