Browse Source

Config.js created

pull/14/merge
Amir 9 years ago
parent
commit
927bd303a2
  1. 36
      js/config.js

36
js/config.js

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
/**
* @author Amir Sanni <amirsanni@gmail.com>
* @date 23-Dec-2016
*/
'use strict';
const appRoot = setAppRoot('webrtc-ratchet-chat-app', '');
const spinnerClass = 'fa fa-spinner faa-spin animated';
function setAppRoot(devFolderName, prodFolderName){
var hostname = window.location.hostname;
/*
* set the appRoot
* This will work for both http, https with or without www
* @type String
*/
//attach trailing slash to both foldernames
var devFolder = devFolderName ? devFolderName+"/" : "";
var prodFolder = prodFolderName ? prodFolderName+"/" : "";
var baseURL = "";
if(hostname === "localhost" || (hostname.search("192.168.") !== -1) || (hostname.search("127.0.0.") !== -1)){
baseURL = window.location.origin+"/"+devFolder;
}
else{
baseURL = window.location.origin+"/"+prodFolder;
}
return baseURL;
}
Loading…
Cancel
Save