Lhdang88 / cloud_computing_ws

Cloud Computing WS Demo App
Apache License 2.0
1 stars 1 forks source link

Cloud Computing Workshop

Chat API-Server, default Port: 3000

REST API:

Websocket API:

Connect to Websocket Endpoint /chat

Websocket are in JSON format. Declare a property named 'action' to invoke functionalities:

{
  "action": ["postMessage" || "postPrivateMessage"],
  "roomId": "roomId_for_postMessage",
  //"userId": "receiverUser_for_postPrivateMessage",
  "user": "senderUser",
  "message": "message",
  "meta": { "foo": "bar"} // additional data to pass
}

returns the message posted and broadcasts the message to users via websocket

{
  "action": "getChatRooms"
}

returns an array of chat room-names via websocket

{
  "action": ["getMessagesInRoom" || "getUsersInRoom"],
  "roomId": "roomId"
}

returns messages ordered by time (users) via websocket

Authentication

The APIs are protected with Basic-Auth. Default credentials are 'dhbw'/'dhbw-pw', but can be overridden with env-variables: DHBW_USER, DHBW_PASSWORD.