TAPI or T-API is a Tea REST API made to show some love for the beverage.
Properties | Description | Type |
---|---|---|
name | the tea name | String |
image | an image url | String |
description | the description | String |
keywords | words associated with the tea | String |
origin | country where the tea is first made | String |
brew_time | time to brew in minutes | Number |
temperature | best temperature in Celsius to drink | Number |
comments | any comments posted about the tea | Array of String |
Routes | HTTP Methods | Description |
---|---|---|
/tea | GET | Displays all tea |
/tea | POST | Creates a new tea |
/tea | DELETE | Deletes all tea |
/tea/:name | GET | Displays a specific tea, given its name |
/tea/:name | POST | Adds a comment to a specific tea, given its name |
/tea/:name | DELETE | Deletes a specific tea, given its name |
Project is created with:
- Node version: 16.18.0
- Express version: 4.18.2
- Mongoose version: 6.8.0
- Multer version: 1.4.5
- MongoDB Atlas
To run this project locally, clone repo and add an .env
file in the root:
MONGODB_URI='mongodb+srv://username:password@cluster0.eetsx.mongodb.net/database_name'
Then execute in command prompt:
$ cd tapi
$ npm install
$ npm start or node server.js
- Populate database (DONE)
- Make a simple PWA using this API (DONE - https://victoria-lo.github.io/Hashtag-TEA/)