-
Notifications
You must be signed in to change notification settings - Fork 0
API
干悦 Yue Gan edited this page Jun 6, 2015
·
8 revisions
| url | method | payload | return | desc |
|---|---|---|---|---|
| /newRoom | POST | {roomName, roomDesc} | roomID | create a new room |
| /register | POST | {username, password} | success | user register |
| /login | POST | {username, password} | (redirect) | user login |
| /logout | GET | (redirect) | user logout | |
| /friend/add | POST | username | success | add friend by username or accept other's friend request |
| /friend/decline | POST | username | success | decline other's friend request |
| /friend/request | GET | {count, [username]} | get all friend request when offline | |
| /friend/all | GET | {count, [friendUsername]} | get all current friends | |
| /invite | POST | {username, roomID} | success | invite a friend to a room |
socket:
server:
| on | payload | desc |
|---|---|---|
| "new roomID" | {roomID, IP} | open a new room |
| "join roomID" | {roomID, IP} | join an exist room |
client:
| on | payload | desc |
|---|---|---|
| "audience change" | [IP] | get updated audience list |
| "friend request" | username | receive friend request |
| "friend change" | {count, [friend] | updated friend list |
| "invite" | {username, roomID} | receive invitation into a room |