GroupomAPI is the API for my Groupomania remake. This api is secure and straightforward.
Clone the project into a directory of your choice
git clone https://github.com/KBerliner/GroupomAPI.gitGo into the project directory
cd my-projectInstall dependencies
npm iStart the server
npm startTo run tests, run the following command
npm test- Signup Endpoint
fetch(`${url}/api/users/signup`, {
method: "POST"
"content-type": "application/json"
body: {
username,
email,
password,
lastLogin,
created
}
});- Login Endpoint
fetch(`${url}/api/users/login`, {
method: "POST",
"content-type": "application/json",
body: {
email,
password,
},
});- Logout Endpoint *
fetch(`${url}/api/users/logout`, {
method: "POST",
});- Delete Account Endpoint *
fetch(`${url}/api/users/delete/`, {
method: "DELETE",
});- Token Refresh Endpoint *
fetch(`${url}/api/users/refresh`, {
method: "POST",
});- Get Users Posts Endpoint
fetch(`${url}/api/users/posts/:userId`);- Create Post Endpoint *
fetch(`${url}/api/posts/`, {
method: "POST",
"content-type": "application/json",
body: {
title,
author,
authorId,
caption,
likesEnabled,
lastUpdated,
created,
},
});- Edit Post Endpoint *
fetch(`${url}/api/posts/update/:id`, {
method: "PUT",
"content-type": "application/json",
body: {
...post,
likesEnabled: false,
},
});- Delete Post Endpoint *
fetch(`${url}/api/posts/delete/:id`, {
method: "DELETE",
});- Get All Posts Endpoint
fetch(`${url}/api/posts/`);* Must Be Logged In