routes.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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("/resetpassword/*", renderer.displayPassReset);
  13. //Merchant
  14. app.post("/merchant/create/none", merchantData.createMerchantNone);
  15. app.post("/merchant/create/clover", merchantData.createMerchantClover);
  16. // app.get("/merchant/recipes/update", merchantData.updateRecipes);
  17. app.delete("/merchant/recipes/remove/:id", merchantData.removeRecipe);
  18. app.put("/merchant/ingredients/add", merchantData.addMerchantIngredient);
  19. app.delete("/merchant/ingredients/remove/:id", merchantData.removeMerchantIngredient);
  20. app.put("/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/create", ingredientData.createIngredient); //also adds to merchant
  29. //Recipes
  30. app.post("/recipe/create", recipeData.createRecipe);
  31. app.put("/recipe/update", recipeData.updateRecipe);
  32. //Orders
  33. //Other
  34. // app.post("/purchases/create", otherData.createOrder);
  35. app.post("/login", otherData.login);
  36. app.get("/logout", otherData.logout);
  37. app.get("/cloverlogin", otherData.cloverRedirect);
  38. app.get("/cloverauth*", otherData.cloverAuth);
  39. app.post("/resetpassword", otherData.resetPassword);
  40. // app.post("/getdata", otherData.getData);
  41. //Transactions
  42. // app.post("/transactions", transactionData.getTransactions);
  43. app.get("/orders", transactionData.getOrders);
  44. // app.post("/transactions/create", transactionData.createTransaction); //Creates transaction for non-pos merchant
  45. app.get("/populatesometransactions", transactionData.populate);
  46. }