routes.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. 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.get("/merchant/recipes/update", merchantData.updateRecipes);
  18. app.post("/merchant/recipes/remove", merchantData.removeRecipe);
  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. //Recipes
  31. app.post("/recipe/create", recipeData.createRecipe);
  32. //Other
  33. app.post("/purchases/create", otherData.createOrder);
  34. app.post("/login", otherData.login);
  35. app.get("/logout", otherData.logout);
  36. app.get("/cloverlogin", otherData.cloverRedirect);
  37. app.get("/cloverauth*", otherData.cloverAuth);
  38. app.post("/resetpassword", otherData.resetPassword);
  39. app.post("/getdata", otherData.getData);
  40. //Transactions
  41. app.post("/transactions", transactionData.getTransactions);
  42. app.get("/purchases", transactionData.getOrders);
  43. app.post("/transactions/create", transactionData.createTransaction); //Creates transaction for non-pos merchant
  44. app.get("/populatesometransactions", transactionData.populate);
  45. }