Kind of like a mutant in-between a boilerplate and a framework for building multi-user WebSocket applications over several client instances.
npm install
npm run dev
runs the development environment using webpack-dev-server + hot reload
npm run dist
builds the production distribution package for JS, CSS and other assetsnpm run start
start-up script
socket.emit('query', data)
data = {
"type": "user"
}
socket.on('query', callback)
{
"type": "user",
"data": {
"name": "Nyan"
}
}
socket.emit('query', data)
data = {
"type": "instance",
"id" : "QWERTY"
}
socket.on('query', callback)
{
"type": "instance",
"data": {
"id" : "QWERTY",
"status": "waiting",
"users" : []
}
}
socket.emit('join', data)
data = {
"id": "QWERTY"
}
socket.on('query', data)
socket.emit('speak', data)
data = {
"message": "Hello!"
}
socket.on('speak', callback)
{
"name" : "Nyan",
"message: "Hello!"
}
socket.emit('leave', data)
data: {
"id": "QWERTY"
}
socket.on('query', data)