From f7f541180745cd7c6235fa5f2832b501cb0669ef Mon Sep 17 00:00:00 2001 From: Kartik Verma <3920286+vkartik97@users.noreply.github.com> Date: Sun, 11 Mar 2018 12:43:55 +0530 Subject: [PATCH] Support for view log files via browser --- autoploy_main.js | 9 +++++++++ public/index.html | 0 public/logs.out | 5 +++++ 3 files changed, 14 insertions(+) delete mode 100644 public/index.html create mode 100644 public/logs.out diff --git a/autoploy_main.js b/autoploy_main.js index 4e533fd..5b01b6f 100644 --- a/autoploy_main.js +++ b/autoploy_main.js @@ -12,6 +12,15 @@ app.use(BodyParser.json()); app.use(express.static(path.join(__dirname, 'public'))); +app.get('/', (req, res) => { + var lines = require('fs').readFileSync("./public/logs.out", 'utf-8').split('\n') + var out = "" + for(var i = 0 ; i < lines.length ; i++) { + out = out + "
" + lines[i] + } + res.send(out) +}) + app.use('/deploy', deploy) // for Github Test Ping diff --git a/public/index.html b/public/index.html deleted file mode 100644 index e69de29..0000000 diff --git a/public/logs.out b/public/logs.out new file mode 100644 index 0000000..32d9e0f --- /dev/null +++ b/public/logs.out @@ -0,0 +1,5 @@ +ls +cd +ls +ls +nma \ No newline at end of file