Skip to content

aresaurus/nodepop-backend-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Nodepop

Nodepop is an API for an e-commerce app that allow users to sell and buy second-hand products. This CRUD API has been created using Node.js, Express and mongoDB, and it allows you to create, edit, delete and filter ads. Each ad follows a name, price, photo, tags and sale (boolean value that informs if an item is for sale or purchase)) schema. MongoDB is used to store this data in a database.

1st step: install mongoDB

mongoDB must be installed in your computer to use this API. To do this:

2nd step: go to the nodepop folder to run the following:

Deploy

npm install

Load initial data to database

npm run init-db

Launch the application in production

npm start

Launch the application for development

npm run dev

API methods

This API uses HTTP methods (GET and POST) to access the items stored in the database. You can find the full list of ads here: http://localhost:3000/api/ads

POST method

Use Postman to update this list or add a new ad. Make sure to select POST, raw and JSON. The schema must be as following:

{ 
  "name": "name of the item",
  "price": number,
  "photo": "photo.png",
  "tags": [ "example1", "example2"],
  "sale": true/false
 }

GET queries

  • For now, the only tags available are lifestyle, work, mobile and motor.

About

E-Commerce API using Node.js and MongoDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published