Added New Folder feature in Image Editor + Winston init refactor

This commit is contained in:
NGPixel
2016-09-28 21:58:18 -04:00
parent 993153072c
commit 90afe796ee
10 changed files with 113 additions and 73 deletions
+8 -10
View File
@@ -5,22 +5,14 @@
// ===========================================
global.ROOTPATH = __dirname;
global.PROCNAME = 'WS';
// ----------------------------------------
// Load Winston
// ----------------------------------------
var _isDebug = process.env.NODE_ENV === 'development';
global.winston = require('winston');
winston.remove(winston.transports.Console)
winston.add(winston.transports.Console, {
level: (_isDebug) ? 'info' : 'warn',
prettyPrint: true,
colorize: true,
silent: false,
timestamp: true
});
global.winston = require('./lib/winston')(_isDebug);
// ----------------------------------------
// Fetch internal handshake key
@@ -141,6 +133,12 @@ io.on('connection', (socket) => {
cb(lcdata.getUploadsFolders());
});
socket.on('uploadsCreateFolder', (data, cb) => {
lcdata.createUploadsFolder(data.foldername).then((fldList) => {
cb(fldList);
});
});
socket.on('uploadsSetFiles', (data, cb) => {
if(internalAuth.validateKey(data.auth)) {
lcdata.setUploadsFiles(data.content);