routes.js 1.9 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. 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.post("/merchant/create/clover", merchantData.createMerchantClover);
  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/password", merchantData.updatePassword);
  22. //Ingredients
  23. app.get("/ingredients", ingredientData.getIngredients);
  24. app.post("/ingredients/create", ingredientData.createIngredient); //also adds to merchant
  25. //Recipes
  26. app.post("/recipe/create", recipeData.createRecipe);
  27. app.put("/recipe/update", recipeData.updateRecipe);
  28. //Orders
  29. app.get("/order", orderData.getOrders);
  30. app.post("/order", orderData.createOrder);
  31. //Other
  32. app.post("/login", otherData.login);
  33. app.get("/logout", otherData.logout);
  34. app.get("/cloverlogin", otherData.cloverRedirect);
  35. app.get("/cloverauth*", otherData.cloverAuth);
  36. app.post("/resetpassword", otherData.resetPassword);
  37. //Transactions
  38. app.get("/populatesometransactions", transactionData.populate);
  39. }