routes.js 2.3 KB

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