diff options
| author | Sacheendra talluri <sacheendra.t@gmail.com> | 2017-04-04 15:34:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-04 15:34:01 +0200 |
| commit | 693a23d17c8783e51a97fd5a2439b5d1ceaa003c (patch) | |
| tree | fdad42c44a147e03101925ffd4d62a869bac4490 /static/index.html | |
| parent | 59b05ac8425e34cdf41179506cdda357c59b4b12 (diff) | |
| parent | fd0376c5a8f018457a11bb0f9602bda366571955 (diff) | |
Merge pull request #6 from atlarge-research/api-over-http
Access API over HTTP
Diffstat (limited to 'static/index.html')
| -rw-r--r-- | static/index.html | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/static/index.html b/static/index.html index 744f7d27..3fc1c2d0 100644 --- a/static/index.html +++ b/static/index.html @@ -3,36 +3,9 @@ <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.6/socket.io.min.js"></script> <script> function onSignIn(googleUser) { - var id_token = googleUser.getAuthResponse().id_token; - - var socket = io.connect('http://' + document.domain + ':' + location.port); - socket.on('connect', function() { - socket.emit('request', { - id: 234, - path: "/v1/simulations/{simulationId}", - method: "GET", - parameters: { - body: { - - }, - path: { - simulationId: 1 - }, - query: { - email:'l.overweel@gmail.com' - } - }, - token: id_token - }); - }) - - socket.on('response', function(response) { - console.log(JSON.parse(response)); - }); + document.getElementById('token').innerText = googleUser.getAuthResponse().id_token; } - </script> - <script> function signOut() { var auth2 = gapi.auth2.getAuthInstance(); @@ -44,3 +17,6 @@ function onSignIn(googleUser) { <div class="g-signin2" data-onsuccess="onSignIn"></div> <a href="#" onclick="signOut();">Sign out</a> + +<p>Your auth token:</p> +<p id="token" style="word-wrap:break-word;">Loading...</p>
\ No newline at end of file |
