add config module

This commit is contained in:
Alexander.Trofimov
2016-03-24 13:41:15 +03:00
parent dfa06d1c89
commit f5e7a8bcdd
9 changed files with 79 additions and 60 deletions

View File

@ -23,7 +23,9 @@
*
*/
var config = require("../config");
var configServer = require('config').get('server');
var siteUrl = configServer.get('siteUrl');
var tempStorageUrl = siteUrl + configServer.get('tempStorageUrl');
var fileUtility = {};
@ -32,7 +34,7 @@ fileUtility.getFileName = function (url, withoutExtension) {
var filename;
if (config.tempStorageUrl && url.indexOf(config.tempStorageUrl) == 0) {
if (tempStorageUrl && url.indexOf(tempStorageUrl) == 0) {
var params = getUrlParams(url);
filename = params == null ? null : params["filename"];
} else {