routes.js 1.8 KB

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