routes.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. const renderer = require("./controllers/renderer");
  2. const merchantData = require("./controllers/merchantData");
  3. const ingredientData = require("./controllers/ingredientData");
  4. const otherData = require("./controllers/otherData");
  5. const transactionData = require("./controllers/transactionData");
  6. const recipeData = require("./controllers/recipeData");
  7. module.exports = function(app){
  8. //Render page
  9. app.get("/", renderer.landingPage);
  10. app.get("/inventory", renderer.displayInventory);
  11. app.get("/recipes", renderer.displayRecipes);
  12. app.get("/information", renderer.displayLegal);
  13. app.get("/data", renderer.displayData);
  14. //Merchant
  15. app.post("/merchant/create/none", merchantData.createMerchantNone);
  16. app.get("/merchant/create/clover", merchantData.createMerchantClover);
  17. app.get("/merchant/recipes/update", merchantData.updateRecipes);
  18. app.post("/merchant/ingredients/create", merchantData.addMerchantIngredient);
  19. app.post("/merchant/ingredients/remove", merchantData.removeMerchantIngredient);
  20. app.post("/merchant/ingredients/update", merchantData.updateMerchantIngredient);
  21. app.post("/merchant/recipes/ingredients/create", merchantData.addRecipeIngredient);
  22. app.post("/merchant/recipes/ingredients/update", merchantData.updateRecipeIngredient);
  23. app.post("/merchant/recipes/ingredients/remove", merchantData.removeRecipeIngredient);
  24. app.post("/merchant/update", merchantData.updateMerchant);
  25. app.post("/merchant/password", merchantData.updatePassword);
  26. //Ingredients
  27. app.get("/ingredients", ingredientData.getIngredients);
  28. app.post("/ingredients/createone", ingredientData.createIngredient); //also adds to merchant
  29. //Recipes
  30. app.post("/recipe/create", recipeData.createRecipe);
  31. //Other
  32. app.post("/transactions/create", otherData.createTransaction); //Creates transaction for non-pos merchant
  33. app.post("/purchases/create", otherData.createPurchase);
  34. app.post("/login", otherData.login);
  35. app.get("/logout", otherData.logout);
  36. app.get("/clover", otherData.clover);
  37. app.get("/cloverlogin", otherData.cloverRedirect);
  38. app.get("/cloverauth*", otherData.cloverAuth);
  39. //Transactions
  40. app.get("/transactions", transactionData.getTransactions);
  41. app.get("/purchases", transactionData.getPurchases);
  42. }