Created
November 16, 2018 14:52
-
-
Save Srushtika/9f88a57a0f7bbaf1671aa42f3c460bf6 to your computer and use it in GitHub Desktop.
WebSockets server tutorial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parseMessage (buffer) { | |
// …all of the above, then: | |
const json = data.toString('utf8'); return JSON.parse(json); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@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 fullserver.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 theserver.js
in the article but it is piece by piece.