Embed Mongodb with Electron


Embed Mongodb with Electron



I am keeping MongoDB source code inside electron source code and running MongoDB using this command :


const app = require('electron').app;
const child_process = require('child_process');
const dbInstanceDir = app.getAppPath();
const startMongo = dbInstanceDir + mongodb/bin/mongod --dbpath mydbpath --port 27017 --logpath mylogfile

child_process.exec(startMongo, (error, stdout, stderr) => {
});



Above command is working while development but it not working after bundling. I am using electron builder to make bundle. MongoDB source code is at root level.



enter image description here





Check in the asar file if there is or not the Mongo folder
– Leonardo Buscemi
2 days ago





Yes, it's there.
– Rohit
2 days ago









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

how to run turtle graphics in Colaboratory

Export result set on Dbeaver to CSV