Skip to content

Instantly share code, notes, and snippets.

@Srushtika
Created November 16, 2018 14:52
Show Gist options
  • Save Srushtika/9f88a57a0f7bbaf1671aa42f3c460bf6 to your computer and use it in GitHub Desktop.
Save Srushtika/9f88a57a0f7bbaf1671aa42f3c460bf6 to your computer and use it in GitHub Desktop.
WebSockets server tutorial
function parseMessage (buffer) {
// …all of the above, then:
const json = data.toString('utf8'); return JSON.parse(json);
}
@ericsonsweah
Copy link

@Srushtika Thank you very much for the article! A question though, what does the full code look like?
for instance, what does the final or full body parseMessage function look like? What does the full server.js in one piece look like if I were for example to clone the repository and open it in my editor? I know you have the server.js in the article but it is piece by piece.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment