routes.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. const orderData = require("./controllers/orderData.js");
  8. module.exports = function(app){
  9. //Render page
  10. app.get("/", renderer.landingPage);
  11. app.get("/dashboard", renderer.displayDashboard);
  12. app.get("/information", renderer.displayLegal);
  13. app.get("/resetpassword/*", renderer.displayPassReset);
  14. //Merchant
  15. app.post("/merchant/create/none", merchantData.createMerchantNone);
  16. app.get("/merchant/create/clover", merchantData.createMerchantClover);
  17. app.delete("/merchant/recipes/remove/:id", merchantData.removeRecipe);
  18. app.post("/merchant/ingredients/add", merchantData.addMerchantIngredient);
  19. app.delete("/merchant/ingredients/remove/:id", merchantData.removeMerchantIngredient);
  20. app.put("/merchant/ingredients/update/:id/:unit", merchantData.ingredientDefaultUnit);
  21. app.put("/merchant/ingredients/update", merchantData.updateMerchantIngredient);
  22. app.post("/merchant/password", merchantData.updatePassword);
  23. //Ingredients
  24. app.get("/ingredients", ingredientData.getIngredients);
  25. app.post("/ingredients/create", ingredientData.createIngredient); //also adds to merchant
  26. //Recipes
  27. app.post("/recipe/create", recipeData.createRecipe);
  28. app.put("/recipe/update", recipeData.updateRecipe);
  29. app.get("/recipe/update/clover", recipeData.updateRecipesClover);
  30. //Orders
  31. app.get("/order", orderData.getOrders);
  32. app.post("/order", orderData.createOrder);
  33. app.delete("/order/:id", orderData.removeOrder);
  34. //Transactions
  35. app.post("/transaction", transactionData.getTransactions);
  36. app.post("/transaction/create", transactionData.createTransaction);
  37. app.delete("/transaction/:id", transactionData.remove);
  38. app.get("/populatesometransactions", transactionData.populate);
  39. //Other
  40. app.post("/login", otherData.login);
  41. app.get("/logout", otherData.logout);
  42. app.get("/cloverlogin", otherData.cloverRedirect);
  43. app.get("/cloverauth*", otherData.cloverAuth);
  44. }