Leave your queries in gitter chat room.
- Group/Room based messaging
- Image, Audio, Video files attachments
- Clone / Download repo
- Run
npm install
to install packages specified in package.json - Create folder
public/images/users/
for file upload - Set up MongoDB, create database and start MongoDB
- Modifiy connection string accordigly in
database/database.js:3
file - Start server using
npm start
or runnodemon
if you have it installed and navigate to http://localhost:3000
Used to create new room. Accepts name
parameter in request data which is name of the room. In response you will get room id and room name.
{ "id": "uniqueRoomId", "name": "some room name" }
Used to get list of all rooms available.
Used to add new user into room. Accepts userName
and email
as request paramas and returns user id and username in response.
{ "id": "uniqueUserId", "name": "User name" }
Used to upload image/audio/video. Accepts single binary file with key file
and returns URL of uploaded file.
{"url": "imageUrl"}
Event is used to add a user into given room. Requires name
(user name), id
(user id), and roomId
(room id) to be passed.
{
"name": "name of the user",
"id": "user id after creating user",
"roomId": "room id"
}
Event is used when someone starts typing. Requires name
of the user who is typing to be passed.
{
"name": "name of the user"
}
Event is used when someone stops typing after some interval. Requires name
of the user who stopped typing to be passed.
{
"name": "name of the user"
}
Event is used when message is added in the room.
Requires following data to be sent in event:
type
of message (text, image, audio, video)text
message text (text message or url in case if type is any of the media)user
name of the user who is sending message
Triggered when new user is added in room. Following data will be available in callback:
{ "joined": "user name who joined", "allUsers": ["Array of all users"] }
Triggered when new message is received in room. Same data will be available as in addedMessageEvent
event.
Triggered when someone in the room starts typing or stops typinh. Same data will be available as in typing
and typingStopped
events.
Triggered when some user leaves the room. Following data will be available in callback:
{ "left": "user name who left", "allUsers": ["Array of all users"] }