Created
June 20, 2019 15:48
-
-
Save abobija/771d824766bf2c56b256b9528542a0b0 to your computer and use it in GitHub Desktop.
WebSocket NodeJS Server written in YouTube video https://www.youtube.com/watch?v=_Z9Axfh6AEU
This file contains 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
const app = require('express')(); | |
const appWs = require('express-ws')(app); | |
app.ws('/echo', ws => { | |
ws.on('message', msg => { | |
console.log('Received: ', msg); | |
ws.send(msg); | |
}); | |
}); | |
app.listen(1337, () => console.log('Server has been started')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment