You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flagon.apache.org by un...@apache.org on 2021/05/10 20:05:09 UTC

[incubator-flagon-useralejs] branch test updated (fae74bd -> d0b2da9)

This is an automated email from the ASF dual-hosted git repository.

unclegedd pushed a change to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-flagon-useralejs.git.


    from fae74bd  updates dependencies
     add 09448c2  updates more deps
     new d0b2da9  fixes example page loading index.js

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 example/server.js |  23 +++---
 package-lock.json | 206 ++++++++++++++++++++++++++++++++++--------------------
 package.json      |  18 ++---
 3 files changed, 153 insertions(+), 94 deletions(-)

[incubator-flagon-useralejs] 01/01: fixes example page loading index.js

Posted by un...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

unclegedd pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-flagon-useralejs.git

commit d0b2da9b3b21f41a92fbbf708ec2df31d023b253
Author: unclegedd <un...@apache.org>
AuthorDate: Mon May 10 15:03:33 2021 -0500

    fixes example page loading index.js
---
 example/server.js | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/example/server.js b/example/server.js
index 5d5cc63..aef6766 100644
--- a/example/server.js
+++ b/example/server.js
@@ -15,13 +15,13 @@
  * limitations under the License.
  */
 
-var express = require('express');
-var bodyParser = require('body-parser');
-var fs = require('fs');
-var path = require('path');
+const express = require('express');
+const bodyParser = require('body-parser');
+const fs = require('fs');
+const path = require('path');
 
-var logDirectory = path.resolve(__dirname, '../logs');
-var logPath = path.resolve(logDirectory, 'logs_' + (new Date()).getTime() + '.json');
+const logDirectory = path.resolve(__dirname, '../logs');
+const logPath = path.resolve(logDirectory, 'logs_' + (new Date()).getTime() + '.json');
 
 try {
   fs.lstatSync(logDirectory);
@@ -29,13 +29,13 @@ try {
   fs.mkdirSync(logDirectory); // Create directory if it doesn't exist
 }
 
-var wStream = fs.createWriteStream(logPath);
+const wStream = fs.createWriteStream(logPath);
 wStream.on('open', function () {
   wStream.write('[');
 });
 
-var firstLog = true;
-var app = express();
+let firstLog = true;
+const app = express();
 
 app.set('port', process.env.PORT || 8000);
 app.use(function (req, res, next) {
@@ -54,6 +54,7 @@ app.use(function (req, res, next) {
 app.use(bodyParser.urlencoded({extended: true, limit: '100mb'}));
 app.use(bodyParser.json({limit: '100mb'}));
 app.use('/build', express.static(path.join(__dirname, '/../build')));
+app.use('/', express.static(__dirname));
 app.set('view engine', 'jade');
 
 
@@ -64,7 +65,7 @@ app.get('/', function (req, res) {
 app.post('/', function (req, res) {
   console.log(req.body);
 
-  var delimiter = ',\n\t';
+  let delimiter = ',\n\t';
 
   if (firstLog) {
     wStream.write('\n\t');
@@ -73,7 +74,7 @@ app.post('/', function (req, res) {
     wStream.write(delimiter);
   }
   
-  var logLength = req.body.length - 1;
+  const logLength = req.body.length - 1;
   req.body.forEach(function (log, i) {
     if (i === logLength) {
       delimiter = '';