playground/client: Use backend proxy.
Backend is now at <proto>://<host>/api by default.
Change-Id: I6ced906a00fdc7f8b10156a3d6c12e890af1673a
diff --git a/client/README.md b/client/README.md
index c6e9f4c..84d9816 100644
--- a/client/README.md
+++ b/client/README.md
@@ -31,6 +31,9 @@
make start
+The client running on localhost needs to have the backend address configured via the
+`pgaddr=` query parameter.
+
As of dec-2014, the playground doc is [here][playground-doc].
# Deploy
diff --git a/client/src/javascript/playground.js b/client/src/javascript/playground.js
index 8223fcf..6991081 100644
--- a/client/src/javascript/playground.js
+++ b/client/src/javascript/playground.js
@@ -150,10 +150,8 @@
pgaddr = '';
}
}
- // TODO(ivanpi): Enable HTTPS and remove port when proxy is set up.
- var origin = 'http://' + window.location.hostname + ':8181';
- //var origin = window.location.protocol + '//' + window.location.host;
- var defaddr = origin.replace('playground', 'pgapi');
+ var origin = window.location.protocol + '//' + window.location.host;
+ var defaddr = origin + '/api';
console.log('Using default backend', defaddr);
return defaddr;
};
diff --git a/go/src/playground/README.md b/go/src/playground/README.md
index 6fd7155..75348cc 100644
--- a/go/src/playground/README.md
+++ b/go/src/playground/README.md
@@ -64,7 +64,8 @@
The server should now be running at http://localhost:8181 and responding to
compile requests at http://localhost:8181/compile.
-Add `?pgaddr=//localhost:8181` to any playground page to make the client talk
-to your server. Add `?debug=1` to see debug info from the builder.
+Add `?pgaddr=http://localhost:8181` to any playground page on localhost to
+make the client talk to your server. Add `?debug=1` to see debug info from
+the builder.
TODO: storage