-
Notifications
You must be signed in to change notification settings - Fork 64
/
index.js
28 lines (20 loc) · 749 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var express = require('express');
var app = express();
var releaseMode = false;
process.argv.forEach(function (val, index, array) {
if(val.toLowerCase().indexOf('release') > 0){
releaseMode = true;
}
});
var staticResourceFolder = releaseMode ? '/dist' : '/public';
app.get('/', function(req, res){
res.redirect('/elasticsearch-connector.html')
});
// Serve everything from the same flat folder in the base web server path
app.use(express.static(__dirname + staticResourceFolder));
app.disable('etag');
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Elasticsearch Tableau Web Data connector server listening at http://%s:%s', host, port);
});