Backend RESTful JSON API with full CRUD using MongoDB, Express and Mongoose for use with Not_OfferUp project This API was created to use as the backend for the OfferUp clone app.
-
Clone repository
clone repo -
Switch to repository
cd into repo -
Install depandencies
npm install -
Change into db directory
cd lib/db -
Seed database
node seed.js -
Change to lib directory
cd .. -
Launch server
npx nodemon index.js -
Open browser and run below url
| URL | PATH | METHOD | DESCRIPTION |
|---|---|---|---|
| / | / | GET | List all items of the listings |
| / | / | POST | Add a new item to the database |
| /{id} | /:id | GET | Render item listing based on the id |
| /{id} | /:id | PUT | Update a specific item based off ID |
| /{id} | /:id | DELETE | Remove a specific item based on ID |
- Mongoose
- Express.js
In the future we would like to include User Authorization/Profiles, and holding images to serve up to the front end.
We ran into multiple issues with CORS and CORB. The CORS issues were resolved by adding CORS and a configuration to allow access from all sites. We are still having an issue with CORB as this is a Chromium security precaution.