routes.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. const transactionData = require("./controllers/transactionData");
  6. module.exports = function(app){
  7. //Render page
  8. app.get("/", renderer.landingPage);
  9. app.get("/inventory", renderer.displayInventory);
  10. // app.get("/merchant/new/clover", renderer.merchantSetupClover);
  11. // app.get("/merchant/new/none", renderer.merchantSetupNone);
  12. app.get("/recipes", renderer.displayRecipes);
  13. app.get("/information", renderer.displayLegal);
  14. app.get("/data", renderer.displayData);
  15. //Merchant
  16. app.post("/merchant/create/none", merchantData.createMerchantNone);
  17. app.get("/merchant/create/clover", merchantData.createMerchantClover);
  18. app.get("/merchant/recipes/update", merchantData.updateRecipes);
  19. app.post("/merchant/ingredients/create", merchantData.addMerchantIngredient);
  20. app.post("/merchant/ingredients/remove", merchantData.removeMerchantIngredient);
  21. app.post("/merchant/ingredients/update", merchantData.updateMerchantIngredient);
  22. app.post("/merchant/recipes/ingredients/create", merchantData.addRecipeIngredient);
  23. app.post("/merchant/recipes/ingredients/update", merchantData.updateRecipeIngredient);
  24. app.post("/merchant/recipes/ingredients/remove", merchantData.removeRecipeIngredient);
  25. app.post("/merchant/update", merchantData.updateMerchant);
  26. app.post("/merchant/password", merchantData.updatePassword);
  27. //Ingredients
  28. app.get("/ingredients", ingredientData.getIngredients);
  29. app.post("/ingredients/createone", ingredientData.createIngredient); //also adds to merchant
  30. //Other
  31. app.post("/transactions/create", otherData.createTransaction); //Creates transaction for non-pos merchant
  32. app.post("/purchases/create", otherData.createPurchase);
  33. app.post("/login", otherData.login);
  34. app.get("/logout", otherData.logout);
  35. app.get("/clover", otherData.clover);
  36. app.get("/cloverlogin", otherData.cloverRedirect);
  37. app.get("/cloverauth*", otherData.cloverAuth);
  38. //Transactions
  39. app.get("/transactions", transactionData.getTransactions);
  40. app.get("/purchases", transactionData.getPurchases);
  41. }