Use ES6 let, change default port to 3000

pull/1/head
Matthew Berryman 2016-07-29 08:59:08 +10:00
rodzic 6e3624d5f8
commit 15bb8962d2
5 zmienionych plików z 16 dodań i 16 usunięć

Wyświetl plik

@ -14,7 +14,7 @@
* @property {number} port Port to launch server on * @property {number} port Port to launch server on
*/ */
var config = {}; let config = {};
// Instance name - default name for this configuration (will be server process name) // Instance name - default name for this configuration (will be server process name)
config.instance = 'node-OpenDroneMap'; config.instance = 'node-OpenDroneMap';
@ -28,7 +28,7 @@ config.logger.maxFiles = 10; // Max number of log files kept
config.logger.logDirectory = ''; // Set this to a full path to a directory - if not set logs will be written to the application directory. config.logger.logDirectory = ''; // Set this to a full path to a directory - if not set logs will be written to the application directory.
// Server port // Server port
config.port = process.env.PORT || 8081; config.port = process.env.PORT || 3000;
// process.env.PORT is what AWS Elastic Beanstalk defines // process.env.PORT is what AWS Elastic Beanstalk defines
// on IBM bluemix use config.port = process.env.VCAP_APP_PORT || 8081; // on IBM bluemix use config.port = process.env.VCAP_APP_PORT || 8081;

Wyświetl plik

@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
"use strict"; "use strict";
var config = require('./config.js') let config = require('./config.js')
let logger = require('winston'); let logger = require('winston');
let fs = require('fs'); let fs = require('fs');
@ -34,7 +34,7 @@ let morgan = require('morgan');
// Set up logging // Set up logging
// Configure custom File transport to write plain text messages // Configure custom File transport to write plain text messages
var logPath = ( config.logger.logDirectory ? config.logger.logDirectory : __dirname ); let logPath = ( config.logger.logDirectory ? config.logger.logDirectory : __dirname );
// Check that log file directory can be written to // Check that log file directory can be written to
try { try {
fs.accessSync(logPath, fs.W_OK); fs.accessSync(logPath, fs.W_OK);
@ -56,7 +56,7 @@ logger
// Console transport is no use to us when running as a daemon // Console transport is no use to us when running as a daemon
.remove(logger.transports.Console); .remove(logger.transports.Console);
var winstonStream = { let winstonStream = {
write: function(message, encoding){ write: function(message, encoding){
logger.info(message.slice(0, -1)); logger.info(message.slice(0, -1));
} }

Wyświetl plik

@ -94,7 +94,7 @@ module.exports = class Task{
this.status = { this.status = {
code: code code: code
}; };
for (var k in extra){ for (let k in extra){
this.status[k] = extra[k]; this.status[k] = extra[k];
} }
} }

Wyświetl plik

@ -207,7 +207,7 @@ module.exports = class TaskManager{
// Serializes the list of tasks and saves it // Serializes the list of tasks and saves it
// to disk // to disk
dumpTaskList(done){ dumpTaskList(done){
var output = []; let output = [];
for (let uuid in this.tasks){ for (let uuid in this.tasks){
output.push(this.tasks[uuid].serialize()); output.push(this.tasks[uuid].serialize());

Wyświetl plik

@ -1,6 +1,6 @@
'use strict'; 'use strict';
var uuid = require('node-uuid'); let uuid = require('node-uuid');
module.exports = function (options) { module.exports = function (options) {
options = options || {}; options = options || {};