- Clone Repo
- Install Postgres (Skip if Installed)
- Start Postgres (Skip if Started)
- Run Command from Shell 'createdb pumpjack_db' to create DB
- cd into pumpjack
- Run 'npm install' or 'yarn install' to install dependencies
- Run Command from Shell 'node db createUserTable' to create User Table
- Run Command from Shell 'node db createProductTable' to create Product Table
- Run Command from Shell 'node db seedUserTable' to seed User Table
- Run Command from Shell 'node db seedProductTable' to seed Product Table
- Run Command from Shell 'node server.js' to start server
- cd into pumpjack-spa
- Run 'npm install' or 'yarn install' to install dependencies
- Run 'npm start' or 'yarn start' to start app.
For restricted endpoints you'll need to request an authorization token (jwt) via a POST request to 'localhost:8080/public/auth' with a JSON object containing an email and password for example:
{"email": "someone@email.com", "password": "some_password"}
When Calling a restricted endpoint you must attach an 'Authorization' header to the request with the authorization token (jwt) from the '/public/auth' endpoint.
netguy87@gmail.com / 123456
banterum@gmail.com / abcdef
tonylee49@icloud.com / abc123
koinverse@gmail.com / 121212
thangso2@uwm.edu / ababab
You can add an image to a product by sending a PUT request to the '/private/addImage/#' where # is the id of the product you are adding the image to.
Please make sure to assign the file object containing the image to the 'image' key as 'multipart/form-data'.
Please make sure to update the environment variables before starting the server.