Configuration split to lists, send configurations and server config.
This is before testing.
This commit is contained in:
parent
4fce4b6f81
commit
c12efeb97f
40 changed files with 819 additions and 311 deletions
29
lib/urls.js
Normal file
29
lib/urls.js
Normal 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
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue