url: https://pets-tinder.herokuapp.com
POST: /api/user/signup
BODY: {
"username": "abcxyz",
"password": "123456",
"full_name": "abcxyz",
"confirmPassword": "123456",
"address": "abcxyz",
"lat": "10.823099",
"lng": "106.629662"
}
POST: /api/user/login
BODY: {
"username": "abcxyz",
"password": "123456",
"lat": "10.823099",
"lng": "106.629662"
}
GET: /api/user
HEADER: {
Authorization: "Bearer ${token}"
}
PUT: /api/user/update
HEADER: {
Authorization: "Bearer ${token}"
}
BODY: {
"email": "[email protected]",
"phone": "0906366223",
"area": 10,
"gender": 0 | 1,
"bio": "Hút thuốc khi buồn",
"address": "ở đâu còn lâu mới nói",
"hobbies": ["id"]
}
POST: /api/user/change-password
HEADER: {
Authorization: "Bearer ${token}"
}
BODY: {
"old_password": "123456",
"new_password": "1234567",
"confirm_password": "1234567",
}
POST: /api/user/upload-avatar
HEADER: {
Authorization: "Bearer ${token}"
}
BODY - FormData: {
avatar: File
}
POST: /api/user/upload-photos
HEADER: {
Authorization: "Bearer ${token}"
}
BODY - FormData: {
photos: Array[Files]
}
POST: /api/user/delete-photo
HEADER: {
Authorization: "Bearer ${token}"
}
BODY: {
"photo": "abcxyz"
}
SOCKET: socket.emit("like-user", {
token: "abcxyz",
userId: "abcxyz"
})
SOCKET: socket.on("like-user-response", (data) => {})
GET: /api/chat?userId=abcxyz
HEADER: {
Authorization: "Bearer ${token}"
}
SOCKET: socket.emit("join", {
token: "abcxyz",
userIds: ["abcxyz"],
})
SOCKET: socket.emit("send-message", {
token: "abcxyz",
userId: "abcxyz",
message: "abcxyz
})
SOCKET: socket.on("send-message-response", (data) => {})
GET: /api/hobby
HEADER: {
Authorization: "Bearer ${token}"
}
POST: /api/user/update-coordinates
HEADER: {
Authorization: "Bearer ${token}"
}
BODY: {
"lat": "10.823099",
"lng": "106.629662"
}
GET: /api/user/can-matching-list
HEADER: {
Authorization: "Bearer ${token}"
}