Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

austinjbennett/dgm4790-node-server

Repository files navigation

dgm4790-node-server

Install and run

To start the server run

npm install

then

npm run start-server

🔹 Mongoose as your data modeling tool
Mongoose was used. Product scheme
🔹 Cloud-based MongoDB as your data store
All data is stored in a mongoDB Atlas Cloud Database
🔹 At least 3 endpoints to GET data from your server

To get a JSON array of all products:

GET localhost:5000/api/products

To get a JSON object of a single product:

GET localhost:5000/api/product/<productId>

where <productId> is the mongoDB '_id' value for the product you want to GET

To get a JSON object of all products in a given category:

GET localhost:5000/api/products/category/<productCategory>

where <productCategory> is the value of the 'productCategory' key for objects you want to GET
(e.g., Wakeboards, Wakeboard%20Bindings, Life%20Jackets, Wakesurf%20Boards)

🔹 At least 1 endpoint allowing user to update an item via PUT or PATCH HTTP verbs

To edit an existing product:

POST localhost:5000/api/edit-product

with the following in the request body:

productId: <productId String>
productCategory: <productCategory String>
title: <title String>
price: <price Number>
imageUrl: <imageUrl String>
description: <description String>

where <productId> is the mongoDB '_id' for the product you want to edit
Replace all values surrounded by < > with the actual product values desired

🔹 At least 1 endpoint allowing user to create an item via POST

To add a new product:

POST localhost:5000/api/add-product

with the following in the request body:

productCategory: <productCategory String>
title: <title String>
price: <price Number>
imageUrl: <imageUrl String>
description: <description String>

Replace all values surrounded by < > with the actual product values desired

🔹 At least 1 endpoint allowing user to delete an item via DELETE

To delete a product:

POST localhost:5000/api/delete-product

with the following in the request body:

productId: <productId String>

where <productId> is the mongoDB '_id' for the product you want to edit

🔹 Your datastore will contain at least 25 items
A request to /api/products will return data for 35 products
🔹 Your app will be deployed to production using some service like Heroku, Digital Ocean, etc.
Deployed to Heroku here: [https://abennett-crud-server.herokuapp.com]
🔹 All of your source code will be properly uploaded to GitHub
Source code hosted on Github here: [https://github.com/skaduusch/dgm4790-node-server]
🔹 Your ReadMe file will accurately describe the server install process (if any) and how to use the APIs
Here you are, at the end of the ReadMe.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published