How to set up Angular2 CLI Project and Node.js app from the same folder
<p>I created a project using the angular2 cli. I also created a separate node js application that acts as the backend. I would like to move my front-end application into the node app, so that I can run both apps using node server.js. My server.js looks like this:</p>

<pre><code>app.use(express.static(__dirname + '/app'));
...
app.get('*', function (req, res) {
    res.sendfile('./app/src/index.html');
});
app.listen(8000);
</code></pre>

<p>My index.html from the angular2 cli looks like this:</p>

<pre><code>&lt;!doctype html&gt;
&lt;html&gt;

&lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;My App&lt;/title&gt;
  &lt;base href="/"&gt;

  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  &lt;link rel="icon" type="image/x-icon" href="favicon.ico"&gt;
&lt;/head&gt;

&lt;body&gt;
  &lt;app-root&gt;Loading...&lt;/app-root&gt;
&lt;/body&gt;
</code></pre>

<p></p>

<p>When I now run node server.js and browse to <a href="http://localhost:8000/" rel="nofollow">http://localhost:8000/</a> then I can see the "Loading..." message, but nothing appears after and there are no errors in the console either. </p>