Configuration split to lists, send configurations and server config.

This is before testing.
This commit is contained in:
Tomas Bures 2018-04-22 17:33:43 +02:00
parent 4fce4b6f81
commit c12efeb97f
40 changed files with 819 additions and 311 deletions

29
lib/urls.js Normal file
View file

@ -0,0 +1,29 @@
'use strict';
const config = require('config');
const url = require('url');
function getTrustedUrl(path) {
return config.www.trustedUrlBase + (path || '');
}
function getSandboxUrl(path) {
return config.www.sandboxUrlBase + (path || '');
}
function getTrustedUrlBaseDir() {
const mailtrainUrl = url.parse(getTrustedUrl());
return mailtrainUrl.pathname;
}
function getSandboxUrlBaseDir() {
const mailtrainUrl = url.parse(getSandboxUrl());
return mailtrainUrl.pathname;
}
module.exports = {
getTrustedUrl,
getSandboxUrl,
getTrustedUrlBaseDir,
getSandboxUrlBaseDir
};