diff --git a/server/config.js b/server/config.js index ad70823..a3388d1 100644 --- a/server/config.js +++ b/server/config.js @@ -126,8 +126,18 @@ if (fs.existsSync(configJSONFile)) { process.exit(1); } +function stripTrailingSlash(obj, field) { + var url = obj[field]; + if (_.isString(url) && _.last(url) === '/') { + obj[field] = url.substr(0, url.length - 1); + } +} + var config = deepExtend({}, defaultConfig, configJSON); +stripTrailingSlash(config.server, 'baseUrl'); +stripTrailingSlash(config.client.map, 'mapUrl'); + module.exports = config; angular.module('ffffng').constant('config', config);