Skip to content

About

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

68 Commits

Folders and files

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

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages