Skip to content

Med-Cabinet-Project/back-end

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

back-end

API Guide

URL https://medcab23.herokuapp.com/

Authentication Routes

POST /api/auth/register

creates a new user account. Then returns an object with the user's info

input: all required

{ email: "ex@fakeemail.com", password: "password", first_name: "firstName", last_name: "lastName" }

output:

{ user: { id: 1 email: "ex@fakeemail.com", first_name: "firstName", last_name: "lastName" }, token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1OTI5NzI0MjIsImV4cCI6MTU5MzA1ODgyMn0.IyLS7AECSWX2WhTza-ZYGurUOZhZlhUGaKeoY1eEehA" }

User Login

POST /api/auth/login

validates user credentials.

Input: all required

{ email: "ex@fakeemail.com", password: "password" }

Output:

{ message: "Welcome ${user.first_name}!", credentials: { user: { id: 1, email: "ex@fakeemail.com", first_name: "firstName", last_name: "lastName" }, token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1OTI5NzI0MjIsImV4cCI6MTU5MzA1ODgyMn0.IyLS7AECSWX2WhTza-ZYGurUOZhZlhUGaKeoY1eEehA" } }

POST /api/strains

creates a new strain in the database

input

{ strain: "Snow White" }

Output:

[ { id: 1, strain: "Snow White" } ]

Helper Routes

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •