Skip to content

Commit

Permalink
Merge pull request #48 from mlem8/master
Browse files Browse the repository at this point in the history
awaiting result of stream.end method; updating Dockerfile node versio…
  • Loading branch information
santthosh committed Jul 5, 2018
2 parents 4876d33 + 1ef0b2b commit 2f1f6db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:6
FROM node:8

WORKDIR /app

Expand Down
11 changes: 9 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ var stream = require('stream');
var figlet = require('figlet');
var basicAuth = require('basic-auth-connect');
var compress = require('compression');
const fs = require('fs');
const homedir = require('os').homedir();

var yargs = require('yargs')
.usage('usage: $0 [options] <aws-es-cluster-endpoint>')
Expand Down Expand Up @@ -149,11 +151,11 @@ if (argv.u && argv.a) {
app.use(basicAuth(argv.u, argv.a));
}

app.use(function (req, res) {
app.use(async function (req, res) {
var bufferStream;
if (Buffer.isBuffer(req.body)) {
var bufferStream = new stream.PassThrough();
bufferStream.end(req.body);
await bufferStream.end(req.body);
}
proxy.web(req, res, {buffer: bufferStream});
});
Expand Down Expand Up @@ -199,3 +201,8 @@ console.log('Kibana available at http://' + BIND_ADDRESS + ':' + PORT + '/_plugi
if (argv.H) {
console.log('Health endpoint enabled at http://' + BIND_ADDRESS + ':' + PORT + argv.H);
}

fs.watch(`${homedir}/.aws/credentials`, (eventType, filename) => {
credentials = new AWS.SharedIniFileCredentials({profile: PROFILE});
AWS.config.credentials = credentials;
});

0 comments on commit 2f1f6db

Please sign in to comment.