-
Method: POST
URI: host / api / users / addUser
body: {
"firstName" : "...",
"lastName" : "...",
"username" : "...",
"email" : "...",
"password" : "..."
} -
Method: POST
URI: host / api / users / login
body: {
"username": "...",
"password": "..."
} -
Method: POST
URI: host / api / users / addFriend
body: {
"username": "...",
"newFriend": "..."
} -
Method: POST
URI: host / api / users / removeFriend
body: {
"username": "...",
"friend": "..."
} -
Method: POST
URI: host / api / users / getFriends / :username
body: null -
Method: POST
URI: host / api / users / getNotFriends / :username
body: null -
Method: POST
URI: host / api / users / getChats / :username
body: null
-
Method: POST
URI: host / api / messages / addMessage
body: {
"author" : [ObjectID],
"receiver" : [ObjectID],
"text" : "...",
"time" : [ms]
} -
Method: POST
URI: host / api / messages / :user1 / :user2
body: null \ -
Method: POST
URI: host / api / messages / deleteMessage
body: {
"id": "..." }
const newUser = {
firstName: firstName,
lastName: lastName,
username: username,
email: email,
password: password
};
axios.post('http://localhost:3001/api/users/addUser', newUser)
.then(res => {
console.log("Utente creato con successo")
console.log(res.data)
})
.catch(error => {
console.error(error);
});