routes.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. const home = require("./controllers/home");
  2. const render = require("./controllers/render");
  3. const merchantData = require("./controllers/merchantData");
  4. module.exports = function(app){
  5. //Render page
  6. app.get("/", render.landingPage);
  7. app.get("/inventory", render.displayInventory);
  8. app.get("/merchant/new/clover", render.merchantSetupClover);
  9. app.get("/merchant/new/none", render.merchantSetupNone);
  10. app.get("/recipes", render.displayRecipes);
  11. //Merchant
  12. app.get("/merchant/recipes/update", merchantData.updateRecipes);
  13. app.post("/merchant/clover/create", merchantData.createMerchantClover);
  14. app.post("/merchant/none/create", merchantData.createMerchantNone);
  15. app.post("/merchant/ingredients/create", merchantData.addMerchantIngredient);
  16. app.post("/merchant/ingredients/remove", merchantData.removeMerchantIngredient);
  17. app.post("/merchant/ingredients/update", merchantData.updateMerchantIngredient);
  18. app.post("/merchant/recipes/ingredients/create", merchantData.addRecipeIngredient);
  19. app.post("/merchant/recipes/ingredients/update", merchantData.updateRecipeIngredient);
  20. app.post("/merchant/recipes/ingredients/remove", merchantData.removeRecipeIngredient);
  21. //Ingredients
  22. app.get("/ingredients", home.getIngredients);
  23. app.post("/ingredients/create", home.createNewIngredients);
  24. app.post("/ingredients/createone", home.createIngredient); //also adds to merchant
  25. //Transactions
  26. app.post("/transactions/create", home.createTransaction);
  27. //Clover API
  28. app.get("/getrecipes", home.getCloverRecipes);
  29. //Other
  30. app.get("/unregistered", home.unregistered);
  31. app.post("/login", home.login);
  32. app.get("/logout", home.logout);
  33. }