study / okdevtv star
kenu.admin kenu.admin 2022-12-26
♻️ refactor
@1ab7601f0a890392c0bdfc3291b6090dbbc67aa5
bin/www
--- bin/www
+++ bin/www
@@ -4,22 +4,22 @@
  * Module dependencies.
  */
 
-var app = require('../app');
-var debug = require('debug')('okdevtv:server');
-var http = require('http');
+const app = require('../app');
+const debug = require('debug')('okdevtv:server');
+const http = require('http');
 
 /**
  * Get port from environment and store in Express.
  */
 
-var port = normalizePort(process.env.PORT || '3000');
+const port = normalizePort(process.env.PORT || '3000');
 app.set('port', port);
 
 /**
  * Create HTTP server.
  */
 
-var server = http.createServer(app);
+const server = http.createServer(app);
 
 /**
  * Listen on provided port, on all network interfaces.
@@ -34,7 +34,7 @@
  */
 
 function normalizePort(val) {
-  var port = parseInt(val, 10);
+  const port = parseInt(val, 10);
 
   if (isNaN(port)) {
     // named pipe
@@ -58,7 +58,7 @@
     throw error;
   }
 
-  var bind = typeof port === 'string'
+  const bind = typeof port === 'string'
     ? 'Pipe ' + port
     : 'Port ' + port;
 
@@ -82,8 +82,8 @@
  */
 
 function onListening() {
-  var addr = server.address();
-  var bind = typeof addr === 'string'
+  const addr = server.address();
+  const bind = typeof addr === 'string'
     ? 'pipe ' + addr
     : 'port ' + addr.port;
   debug('Listening on ' + bind);
lib/db.js
--- lib/db.js
+++ lib/db.js
@@ -1,5 +1,5 @@
-var mysql = require('mysql');
-var connection = mysql.createConnection({
+const mysql = require('mysql');
+const connection = mysql.createConnection({
     host: 'localhost',
     user: process.env.DB_USER || 'devuser',
     password: process.env.DB_PASS || 'okpassokpass',
lib/sheetdb.js
--- lib/sheetdb.js
+++ lib/sheetdb.js
@@ -20,7 +20,6 @@
     });
     await doc.loadInfo(); // loads document properties and worksheets
 
-    // const sheet = doc.sheetsByIndex[info.index]; // or use doc.sheetsById[id]
     const sheet = doc.sheetsById[info.id]; // or use doc.sheetsById[id]
     return sheet;
   }
public/kr/socket.io-chat-kr.html
--- public/kr/socket.io-chat-kr.html
+++ public/kr/socket.io-chat-kr.html
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html>
+<html lang="en">
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <title>socket.io-chat-kr.html</title>
public/md/codetip/codetip.md
--- public/md/codetip/codetip.md
+++ public/md/codetip/codetip.md
@@ -5,9 +5,7 @@
 ```js
 function sleep(timeMillis, callback) {
   var stop = Date.now();
-  while (Date.now() < stop + timeMillis) {
-    // This is intentional
-  }
+  while (Date.now() < stop + timeMillis) {}
   callback();
 }
 ```
sonar-project.properties
--- sonar-project.properties
+++ sonar-project.properties
@@ -9,8 +9,8 @@
 # If not set, SonarQube starts looking for source code from the directory containing
 # the sonar-project.properties file.
 sonar.sources=.
-sonar.exclusions=test/**, node_modules/**, public/api/**, public/sh_3.0.83/**, public/slides.html5rocks.com/**, public/js/**/*.min.js, public/js/init.js
-sonar.login=f0a630cae1axxxxxxxxx9dbdefc40ba530bc
+sonar.exclusions=test/**, node_modules/**, public/**
+sonar.login=squ_7c74fc757207d8a6533bc4c4a7a156a178ec0174
 
 # Encoding of the source code. Default is default system encoding
 sonar.sourceEncoding=UTF-8
Add a comment
List