Skip to content
This repository has been archived by the owner on Mar 1, 2018. It is now read-only.

Commit

Permalink
Move the image path to the client side
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Herrmann committed Nov 14, 2017
1 parent 8f24575 commit cdd76e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function broadcast(intent, uuid) {
return;
}
if (ws.readyState === WebSocket.OPEN) {
ws.send(`img/intents/${intent}.png`);
ws.send(intent);
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@
if (event.data === 'pong') {
console.log(new Date() + ': got pong');
} else {
console.log(new Date() + ': got image "' + event.data + '"');
image(event.data);
console.log(new Date() + ': got intent "' + event.data + '"');
image('img/intents/' + event.data + '.png');
}
};
</script>
Expand Down

0 comments on commit cdd76e7

Please sign in to comment.