Skip to content

Latest commit

 

History

History
125 lines (85 loc) · 2.26 KB

socket-server.md

File metadata and controls

125 lines (85 loc) · 2.26 KB

Codesling Realtime Socket Server Developer Documentation

Note: If you want to run all backend services along with the clientside development server, check out the main README.md instructions

To begin developing on the realtime websocket server, run the following from the socket-server folder:

yarn
yarn start

Documentation Table of Contents:

API

Client Events:

client.ready

Emit to the server when component has loaded and is ready to receive updates

payload: {}

client.update

Emit to the server when user has changed the state of the code editor

payload: {
  text: STRING
}

client.run

Emit to the server when a user wants to run the code in the code editor

payload: {}

client.disconnect

Emit to the server when the code editor component unmounts (user navigates away from the editor page)

payload: {}

client.message

Emit to the server when the user sends a message via chat

payload: {
  message: STRING,
  username: STRING
}

Server Events:

server.initialState

Emitted initially (once) by the server after client has verified that it is ready to begin rendering code editor text updates

payload: {
  text: STRING
}

server.changed

Emitted by the server when the state of the code editor is altered by another client

payload: {
  text: STRING
}

server.run

Emitted by the server when the stdout from the code editor has been evaluated

payload: {
  stdout: STRING
}

server.leave

Emitted by the server when another client leaves the code editing session

payload: {}

server.message

Emitted by the server when another client sends a message via chat

payload: {
  message: STRING,
  username: STRING
}