Where is the servable index.html in this Angular2 / Node app?
<p>I have made minor modifications to <a href="https://github.com/blacksonic/angular2-esnext-starter" rel="nofollow">this Angular2 GitHub sample app</a> so that it uses Express instead of KOA.  But the problem is that FireFox gives the following error in the console when the root url of the app is loaded:  </p>

<pre><code>GET http://localhost:8080/vendor.js [HTTP/1.1 200 OK 16ms]  
GET http://localhost:8080/boot.js [HTTP/1.1 200 OK 16ms]
The stylesheet http://localhost:8080/boot.css was not loaded because its MIME type, "text/html", is not "text/css". localhost:8080
SyntaxError: expected expression, got '&lt;' vendor.js:1:0
SyntaxError: expected expression, got '&lt;' boot.js:1:0
GET http://localhost:35729/livereload.js [HTTP/1.1 200 OK 9ms]
GET http://localhost:35729/livereload [HTTP/1.1 101 Switching Protocols 2ms]
</code></pre>

<p>It seems that the browser is not able to read the ES6 in the app.  In the sample app, Babel is used to compile the ES6 into a browser-readable form.  I have not changed the <code>gulpfile.js</code> or anything other than <code>router.js</code>, <code>server/index.js</code>, and <code>package.json</code>.  But somehow serving <code>index.html</code> does not give the client anything that it can read.  </p>

<p><strong>What is the correct way to serve an ES6/Angular2 app from Express.js?  And what specific changes need to be made to the code below to resolve these console errors in the modified GitHub sample?</strong>  </p>

<p>Here are the two versions of the express route in <a href="https://github.com/blacksonic/angular2-esnext-starter/blob/master/server/router.js" rel="nofollow"><code>router.js</code></a> that each generate the same error shown above:  </p>

<p>Version 1:  </p>

<pre><code>'use strict';

// expose the routes to our app with module.exports
module.exports = function(app) {

    //other routes omitted for brevity

    app.get('*', function(req, res) {
        console.log('inside / route!');
        res.sendfile(path.resolve('dist/client/index.html')); // load the single view file (angular will handle the front-end)
    });
};
</code></pre>

<p>And version 2:  </p>

<pre><code>'use strict';

// expose the routes to our app with module.exports
module.exports = function(app) {

    //other routes omitted for brevity

    app.get('*', function(req, res) {
        console.log('inside / route!');
        res.sendfile(path.resolve('client/index.html')); // load the single view file (angular will handle the front-end)
    });
};
</code></pre>

<p><strong>Is serving <code>index.html</code> the problem?  Is there a better way to send the app from Express to the browser?</strong>  </p>

<p>The new <a href="https://github.com/blacksonic/angular2-esnext-starter/blob/master/server/index.js" rel="nofollow"><code>server/index.js</code></a> is:  </p>

<pre><code>// set up ======================================================================
var express  = require('express');
var app      = express();                               // create our app w/ express
var port     = process.env.PORT || 8080;                // set the port
var morgan = require('morgan');             // log requests to the console (express4)
var bodyParser = require('body-parser');    // pull information from HTML POST (express4)
var methodOverride = require('method-override'); // simulate DELETE and PUT (express4)

app.use(express.static(__dirname + '/client'));                 // set the static files location /public/img will be /img for users
app.use(morgan('dev'));                                         // log every request to the console
app.use(bodyParser.urlencoded({'extended':'true'}));            // parse application/x-www-form-urlencoded
app.use(bodyParser.json());                                     // parse application/json
app.use(bodyParser.json({ type: 'application/vnd.api+json' })); // parse application/vnd.api+json as json
app.use(methodOverride());
app.use('/scripts', express.static(__dirname + '/node_modules/'));

// load the routes
require('./router')(app);

// listen (start app with node server.js) ======================================
app.listen(port);
console.log("App listening on port " + port);
</code></pre>

<p>The only other file that changed is <code>package.json</code>, but I am omitting it here for brevity because it just lists new dependencies.  I can post it if requested by someone who is actually looking at this problem.</p>