title: Using Express inside Atom Electron
body: <p>I have an application running Express, and I am trying to distribute it using <a href="https://github.com/atom/electron/blob/master/docs/tutorial/application-distribution.md" rel="nofollow noreferrer">electron</a>.</p>
  
  <p>Running electron in debug with this:</p>
  
  <pre><code>/path/to/electron/Electron.app/Contents/MacOS/Electron path-to-my-app
  </code></pre>
  
  <p>My application runs perfectly fine. Express fires up its server and everything works -- the main window opens correctly using <code>mainWindow.loadUrl('http://localhost:3000/');</code></p>
  
  <p>When I follow the <em>distribution</em> tutorial (linked before) I copy my application resources to:</p>
  
  <pre><code>/path/to/electron/Electron.app/Contents/Resources/app
  </code></pre>
  
  <p>But now when I run Electron.app, I see <code>Cannot GET /</code> in the main window... but I have no idea why.</p>
  
  <p>Any ideas?</p>
  
  <p>My only thought is that <code>process.cwd()</code> is not correctly helping me define the document root here:</p>
  
  <pre><code>//configure Express to default web requests to /workspace/ folder
  expressApp.use(express.static(process.cwd() + '/workspace'));
  </code></pre>
  
  <p>But if that's the case, I don't know how to get around it.</p>