routes.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. module.exports = function(app){
  6. //Render page
  7. app.get("/", renderer.landingPage);
  8. app.get("/inventory", renderer.displayInventory);
  9. app.get("/merchant/new/clover", renderer.merchantSetupClover);
  10. app.get("/merchant/new/none", renderer.merchantSetupNone);
  11. app.get("/recipes", renderer.displayRecipes);
  12. app.get("/legal", renderer.informationPage);
  13. //Merchant
  14. app.get("/merchant/recipes/update", merchantData.updateRecipes);
  15. app.post("/merchant/clover/create", merchantData.createMerchantClover);
  16. app.post("/merchant/none/create", merchantData.createMerchantNone);
  17. app.post("/merchant/ingredients/create", merchantData.addMerchantIngredient);
  18. app.post("/merchant/ingredients/remove", merchantData.removeMerchantIngredient);
  19. app.post("/merchant/ingredients/update", merchantData.updateMerchantIngredient);
  20. app.post("/merchant/recipes/ingredients/create", merchantData.addRecipeIngredient);
  21. app.post("/merchant/recipes/ingredients/update", merchantData.updateRecipeIngredient);
  22. app.post("/merchant/recipes/ingredients/remove", merchantData.removeRecipeIngredient);
  23. //Ingredients
  24. app.get("/ingredients", ingredientData.getIngredients);
  25. app.post("/ingredients/create", ingredientData.createNewIngredients);
  26. app.post("/ingredients/createone", ingredientData.createIngredient); //also adds to merchant
  27. //Other
  28. app.post("/transactions/create", otherData.createTransaction); //Creates transaction for non-pos merchant
  29. app.post("/purchases/create", otherData.createPurchase);
  30. app.post("/login", otherData.login);
  31. app.get("/logout", otherData.logout);
  32. app.post("/email", otherData.checkUniqueEmail);
  33. app.get("/cloverlogin", otherData.clover);
  34. app.get("/cloverauth*", otherData.cloverAuth);
  35. }