For development purposes place .env file in root folder
POST
/login/logout/register/create- post creation
GET
/user/{id}/user-- returns the authenticated user'susername,email/posts?offset={1}&limit={1}-- optional parameters for lazy loading/posts-- all posts/post/{id}-- specific post/ping-- just to see if the server is running properly
- register
fetch("api.domain.com/register", {
method: "POST",
headers: {
"Content-type": "application/json",
},
body: JSON.stringify({ username, email, password }),
});- login
fetch("api.domain.com/login", {
method: "POST",
headers: {
"Content-type": "application/json",
},
body: JSON.stringify({ email, password }),
});- create post
fetch("api.domain.com/create", {
method: "POST",
headers: {
"Content-type": "application/json",
},
body: JSON.stringify({ title, content }),
});