var express = require('express');
var app = express();

var user = process.env.USER;
var pass = process.env.PASS;

app.set('port', process.env.PORT || 3000);

if (user && pass) {
  app.use(express.basicAuth(user, pass));
}

app.use(express.logger('dev'));
app.use(express.compress());
app.use(express.static(__dirname + '/dist'));

app.listen(app.get('port'), function() {});

var express = require('express');
var app = express();

app.set('port', process.env.PORT || 3000);

app.use('/', express.static('./dist'));

app.listen(app.get('port'), function() {
  console.log('server listening on port :' + app.get('port'));
});

update server.js