Skip to content

Backend API built with Node.js, Express, and MySQL that allows user to store information regarding their plants

License

Notifications You must be signed in to change notification settings

Water-My-Plants-PTCT/plants-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

backend

baseUrl: https://water-my-plants-ptct.herokuapp.com

Auth Endpoints | Required Fields | Description

POST REQUESTS:

/api/auth/login | username, password | login user and set token [test user]: username= test, password= test

/api/auth/register | username, phone, password | register user and save credentials to server, username/phone must be unique (non-duplicates in system), username must be a string that is min 3 chars long and phone # must be 10 digits long

/api/auth/logout | user must be logged in | Allows user to logout and remove token and session id

PUT REQUESTS:

/api/auth/users/:id | phone OR password | User can update their phone number or password. Phone number must be unique (non-duplicates in system)

Plant Endpoints | Required Fields / Token | Description

GET REQUESTS:

/api/plants | Token Required | Get's a list of all plants in database

/api/plants/:id | Token Required | Get's a specific plant based on the plant_id

/api/plants/user/:id | Token Required | Gets a list of plant data from a specific user id

POST REQUESTS:

/api/plants | Token Required, Required Fields: | Creates a new plant and returns an object. Optional: User can insert an image url to be saved to nickname, species, h2oFrequency, database. Ex: https://thumbs.dreamstime.com/z/cambria-orchid-plant-blooming-white-38131910.jpg user_id, photo(optional, user can insert an image url)

PUT REQUESTS:

/api/plants/:id | Token Required, Required Fields: | Allows user to update information about a specific plant based on the plant_id user can update any of the plant fields (nickname, species, h20frequency, etc)

DELETE_REQUESTS:

/api/plants/:id | Token Required | Allows user to delete a specific plant based on the plant_id

About

Backend API built with Node.js, Express, and MySQL that allows user to store information regarding their plants

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published