routes.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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.post("/merchant/recipes/remove", merchantData.removeRecipe);
  18. // app.post("/merchant/ingredients/add/:id", merchantData.addMerchantIngredient);
  19. // app.post("/merchant/ingredients/remove", 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. //Orders
  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("/orders", transactionData.getOrders);
  43. // app.post("/transactions/create", transactionData.createTransaction); //Creates transaction for non-pos merchant
  44. app.get("/populatesometransactions", transactionData.populate);
  45. }