Skip to content

Build-Week-African-Marketplace-2020/back-end

Repository files navigation

back-end

Deployed backend link https://africanmarketplacels.herokuapp.com/

User Routes ⬇️

auth/register -- A POST request to register a new user. Requires a username, password, first_name, last_name

{ username: "aaron", password: "test123", first_name: "Aaron", last_name: "Spurgeon" }

auth/login -- A POST request to login. Requires a username and password

{ username: "login", password: "test123" }

auth/logout -- Route that logs out a user that is currently inside session store.

Marketplace Routes ⬇️

mp/products -- A GET request to get a list of all available products

mp/products(POST) -- A POST request to post a new product to the DB, this is a protected route so you have to be logged in to post a new product

{ "name": "Celery", "location": "Uganda", "price": "1", "category_id": 3 }

mp/products/:id -- A GET request to grab a specific product by id to see it's details

mp/products/:id -- PUT request to update a specific product

{ "name": "super celery", "location": "Uganda", "price": "1", "category_id": 3 }

mp/products/:id -- DEL request to delete a specific product from DB

mp/categories -- A GET request to get a list of all available categories

mp/categories/:id -- A GET request to grab a specific category by id

mp/categories(POST) -- A POST request to create a new category for products to be placed if need. This is a protected route so the user needs to be logged in.

{ "name": "Grains", "commodity_id": 2 }

mp/comms -- A GET request to get a list of all available commodities

mp/comms/:id -- A GET request to get a commodity by id

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published