-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
executable file
·88 lines (60 loc) · 2.73 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
const express = require("express")
var bodyParser = require('body-parser')
var cors = require("cors");
//-------------------------------------------------------
const app = express()
app.use(cors())
require("./db/db")
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
// -------------------------------router for wake a server------------------
const healthRoute = require("./routes/healthRoute")
app.use("/health",healthRoute)
//-----------------------Register Route----------------------------------------
const UserRegrestrationRoute = require("./routes/UserRegrestrationRoute")
app.use("/",UserRegrestrationRoute)
//----------------------------Login Route----------------------------
const UserLoginRoute = require("./routes/UserLoginRoute")
app.use("/",UserLoginRoute)
//-----------------------Cart Route---------------------------------
const CartRoutes = require('./routes/CartRoutes')
app.use("/cart", CartRoutes)
//--------------------------get products ----------------------
const getProductsRoute = require("./routes/getProductsRoute")
app.use("/",getProductsRoute)
//--------------------------Product-Description------------------
const ProductDescRoute = require("./routes/ProductDescRoute")
app.use("/",ProductDescRoute)
//--------------------------- insert brand------------------
const BrandAdd = require("./routes/BrandAdd");
app.use("/brand",BrandAdd);
//-----------------------password routes------------------------
const PasswordRoutes = require('./routes/PasswordRoutes');
app.use("/password", PasswordRoutes);
//--------------------filters--------------------
const filterRoute = require("./routes/filterRoute");
app.use("/",filterRoute);
//----------------------Reviews----------------------
const reviewRoute = require("./routes/reviewRoute")
app.use("/review",reviewRoute)
//----------------------searc----------------------
const SearchRoute = require("./routes/SearchRoute")
app.use("/search",SearchRoute)
//----------------------user routes-------------------------
const UserRoutes = require('./routes/UserRoutes')
app.use("/user", UserRoutes)
//---------------------admin routes--------------------
const AdminRoutes = require('./routes/AdminRoutes')
app.use("/admin", AdminRoutes)
//--------------------product routes-----------------
const ProductRoutes = require('./routes/ProductRoutes')
app.use("/", ProductRoutes)
//--------------------------checkOut route----------------
const checkOutRoute = require('./routes/checkOutRoute')
app.use("/checkout",checkOutRoute)
// -----------------payment----------------
const paymentRoute = require('./routes/paymentRoute')
app.use("/payment",paymentRoute)
app.listen(9999, ()=>{
console.log("server is running on port : ", 9999)
});