I'm having problems with an electron app that makes calls to an API using a server build with express and Node.Js. The problem is that when i build the APP i can't find a way of executing the server in the background. If you know anything please let me know. Thank you!
            Asked
            
        
        
            Active
            
        
            Viewed 481 times
        
    1 Answers
0
            
            
        I don't know your code looks like but I assume you have something like this:
function createWindow () {
  let win = new BrowserWindow({
    width: 600,
    height: 400,
    webPreferences: {
      nodeIntegration: true
    }
    ...
 });
What you could do is have nodeIntegration: true and then you could include the server files run in your index.html file. <script src=fileServer.js></script>. This allows script files to use node specific functions such as require('express') or something along those lines.
Again I can't help much more because I don't know what your code looks like.
 
    
    
        Matthias Southwick
        
- 101
- 9
