Skip to content

KBerliner/GroupomAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GroupomAPI

GroupomAPI is the API for my Groupomania remake. This api is secure and straightforward.

JavaScriptNodeJSExpressMongoDB

Run Locally

Clone the project into a directory of your choice

  git clone https://github.com/KBerliner/GroupomAPI.git

Go into the project directory

  cd my-project

Install dependencies

  npm i

Start the server

  npm start

Running Tests

To run tests, run the following command

  npm test

Usage

  • 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

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published