routes

Express server application providing routes/access to the mysql database

Source:

Requires

  • module:express
  • module:bodyParser
  • module:mysql
  • module:twilio
  • module:secrets

Members

(inner, constant) bodyParser

body-parser module

Source:

(inner, constant) client

twilio instance

Source:

(inner, constant) connection

mysql connection to our database

Source:

(inner, constant) express

express module

Source:

(inner, constant) mysql

mysql module

Source:

(inner, constant) secrets

secrets module containing database passwords, authTokens, ids and other secrets

Source:

Methods

(inner) get/AllDishes()

Route to return all dish entries in the dish table

Source:

(inner) get/AllReviews()

Route to return all reviews in Review table

Source:

(inner) get/AvailableDishes()

Route to return all currently available dish entries in the dish table

Source:

(inner) get/ChefInfo()

Route to return the table entry for a specified chef

Source:

(inner) get/Chefs()

Route to return all chef entries in the chef table

Source:

(inner) get/ChefsDishes()

Route to return all dish entries for a given chef

Source:

(inner) get/CoverPhotos()

Route to return all dish primary images for a specified chef ordered by dish rating

Source:

(inner) get/CreateDB()

Route to run create database query to initialize Potluck database

Source:

(inner) get/CreateTables()

Route to run create table queries from create_tables.sql to create all relevant tables

Source:

(inner) get/DishInfo()

Route to return dih information for a specific dish

Source:

(inner) get/getChefReviews()

Route to return all reviews for a given chef

Source:

(inner) get/getDishReviews()

Route to return all reviews for a given dish

Source:

(inner) get/getNChefReviews()

Route to return the most recent N reviews for a given chef

Source:

(inner) get/getNDishReviews()

Route to return the most recent N reviews for a given dish

Source:

(inner) get/insertChefs()

Route to run insert values query to insert dummy chef data from local csv's

Source:

(inner) get/insertDishes()

Route to run insert values query to insert dummy dish data from local csv's

Source:

(inner) get/newReview()

Route to run insert query to add a new review to Review table

Source:

(inner) get/ShowTables()

Route to run show tables query

Source:

(inner) get/updateChefWithNewReview()

Route to update query to update rating and numReviews for specific chef in Chef table

Source:

(inner) get/updateDishWithNewReview()

Route to update query to update rating and numReviews for specific dish in Dish table

Source:

(inner) post/textChef()

Route to run post request to send texts to chefs

Source: