routes.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435
  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. //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. //Other
  27. app.post("/transactions/create", otherData.createTransaction); //Creates transaction for non-pos merchant
  28. app.post("/login", otherData.login);
  29. app.get("/logout", otherData.logout);
  30. app.post("/email", otherData.checkUniqueEmail);
  31. }