summaryrefslogtreecommitdiff
path: root/resources/templates/GcmEndpoints/root/src/webapp/index.html.ftl
diff options
context:
space:
mode:
Diffstat (limited to 'resources/templates/GcmEndpoints/root/src/webapp/index.html.ftl')
-rw-r--r--resources/templates/GcmEndpoints/root/src/webapp/index.html.ftl9
1 files changed, 7 insertions, 2 deletions
diff --git a/resources/templates/GcmEndpoints/root/src/webapp/index.html.ftl b/resources/templates/GcmEndpoints/root/src/webapp/index.html.ftl
index 7070937..21e9927 100644
--- a/resources/templates/GcmEndpoints/root/src/webapp/index.html.ftl
+++ b/resources/templates/GcmEndpoints/root/src/webapp/index.html.ftl
@@ -101,8 +101,13 @@
function init() {
var apiName = 'messaging'
var apiVersion = 'v1'
- // set the apiRoot to work on a deployed app and locally
- var apiRoot = '//' + window.location.host + '/_ah/api';
+ var apiRoot = 'https://' + window.location.host + '/_ah/api';
+ if (window.location.hostname == 'localhost'
+ || window.location.hostname == '127.0.0.1'
+ || ((window.location.port != "") && (window.location.port > 1023))) {
+ // We're probably running against the DevAppServer
+ apiRoot = 'http://' + window.location.host + '/_ah/api';
+ }
var callback = function() {
enableClick();
}