Closed puentesdiaz closed 3 years ago
That's not really what this library does. You're attempting to create multiple processes and use a third party runner (webpack dev server).
What you could do is this:
var Service = require('node-windows').Service;
// Create a new service object
var svc = new Service({
name:'My API Server',
description: 'My backend',
script: 'C:\\path\\to\\api-server.js',
//, workingDirectory: '...'
//, allowServiceLogon: true
});
// Listen for the "install" event, which indicates the
// process is available as a service.
svc.on('install',function(){
svc.start();
});
svc.install();
You could also run the dev server as its own background service. I don't use webpack, so I'm not sure what you'd need to do with that.
One thing I'd like to point out is this library is designed for creating production background services.
i have a package.json like...
`"scripts": {
},`
i usually execute with : npm run startServers
how can i user node-windows for the same?