Browse Source

made chanegs for changing routes to /api/*
Also changes to require(http)

Ramya 2 tháng trước cách đây
mục cha
commit
7bc24a1ebc
2 tập tin đã thay đổi với 19 bổ sung19 xóa
  1. 1 1
      app.js
  2. 18 18
      routes/route.js

+ 1 - 1
app.js

@@ -1,7 +1,7 @@
 const express = require('express');
 const bodyParser = require('body-parser');
 const routes = require('./routes/route');
-const https=require("https");
+const https=require("http");
 //const routes = require('../DVR-BACKEND/routes/route');
 const fs = require('fs');
 

+ 18 - 18
routes/route.js

@@ -9,36 +9,36 @@ const auth = require("../middlewares/authorize");
 router.use(bodyParser.urlencoded({ extended: true }))
 router.use(bodyParser.json());
 
-router.post("/signupuser", loginController.signupuser);
-router.post("/loginuser", loginController.loginUser);
-router.get("/getselectionData",auth,dvrController.getselectionData);
+router.post("/api/signupuser", loginController.signupuser);
+router.post("/api/loginuser", loginController.loginUser);
+router.get("/api/getselectionData",auth,dvrController.getselectionData);
 
 
-router.post("/createContactEntry",auth,dvrController.createContactEntry);
+router.post("/api/createContactEntry",auth,dvrController.createContactEntry);
 
 
-router.get("/getdvrdetails",auth,dvrController.getdvrDetails);
-router.get("/getdashboarddetails",auth,dvrController.getdashboarddetails);
+router.get("/api/getdvrdetails",auth,dvrController.getdvrDetails);
+router.get("/api/getdashboarddetails",auth,dvrController.getdashboarddetails);
 
-router.post("/createDvrEntry",auth,dvrController.createDvrEntry);
-router.put("/updateDvrEntry",auth,dvrController.updatedvrDetails);
+router.post("/api/createDvrEntry",auth,dvrController.createDvrEntry);
+router.put("/api/updateDvrEntry",auth,dvrController.updatedvrDetails);
 
-router.post("/userrolemap",auth ,loginController.userrolemap);
+router.post("/api/userrolemap",auth ,loginController.userrolemap);
 
-router.post("/createCustomerEntry",auth,dvrController.createCustomerentry);
+router.post("/api/createCustomerEntry",auth,dvrController.createCustomerentry);
 
-router.put("/updateContactDetails",auth,dvrController.updateContactDetails);
-router.put("/updateCustomerDetails",auth,dvrController.updateCustomerDetails);
-router.get("/getlastestdvr",auth,dvrController.getlastestdvr);
+router.put("/api/updateContactDetails",auth,dvrController.updateContactDetails);
+router.put("/api/updateCustomerDetails",auth,dvrController.updateCustomerDetails);
+router.get("/api/getlastestdvr",auth,dvrController.getlastestdvr);
 
-router.get("/getcontactdetails",auth,dvrController.getcontactDetails);
+router.get("/api/getcontactdetails",auth,dvrController.getcontactDetails);
 
-router.get("/getsalepersonlist",auth,dvrController.getsalePersonList);
+router.get("/api/getsalepersonlist",auth,dvrController.getsalePersonList);
 
-router.get("/getcustcontactdetails",auth,dvrController.getCustcontactDetails);
-router.post("/createUpdateCustomerentry",auth,dvrController.createUpdateCustomerentry);
+router.get("/api/getcustcontactdetails",auth,dvrController.getCustcontactDetails);
+router.post("/api/createUpdateCustomerentry",auth,dvrController.createUpdateCustomerentry);
 
-router.post("/deletedvrEntry",auth,dvrController.deletedvrEntry);
+router.post("/api/deletedvrEntry",auth,dvrController.deletedvrEntry);