
// build may prepend 'devWithPreprod'

var prod = "https://pol.is/";
var preprod = "https://preprod.pol.is/";
var embed = "https://embed.pol.is/";
var survey = "https://survey.pol.is/";
var polisio = "https://www.polis.io/";
var localhost = "http://localhost:5000/";
var localhost8000 = "http://localhost:8000/";
var urlPrefix = prod;
if (document.domain.indexOf("preprod") >= 0) {
    urlPrefix = preprod;
}
if (document.domain.indexOf("embed") >= 0) {
    urlPrefix = embed;
}
if (document.domain.indexOf("survey") >= 0) {
    urlPrefix = survey;
}
if (document.domain.indexOf("polis.io") >= 0) {
    urlPrefix = polisio;
}
if ((-1 === document.domain.indexOf("pol.is")) && (-1 === document.domain.indexOf("polis.io"))) {
    urlPrefix = localhost;
}

if (document.domain === "localhost" && document.location.port === "8000") {
	urlPrefix = localhost8000;
}

function isPreprod() {
	return urlPrefix === preprod;
}

function isLocalhost() {
	return urlPrefix === localhost || urlPrefix === localhost8000;
}

module.exports = {
  urlPrefix: urlPrefix,
  isPreprod: isPreprod,
  isLocalhost: isLocalhost
};
@@ -851,24 +851,166 @@
 ost8000;%0A%7D%0A%0A
+if (0 === document.domain.indexOf(%22192.168%22)) %7B%0A  urlPrefix = %22http://%22 + document.location.hostname + %22:%22 + document.location.port + %22/%22;%0A%7D%0A%0A
 function isP

allow running over local network