routes.js 1.6 KB

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