-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
52 lines (31 loc) · 1.14 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
const express = require('express')
//Create Seller
const {createSeller,callSeller,getSellerById,updateSellerById,deleteSellerById}= require('./controllers/seller.controller')
//Create Product
const {createProduct,callProduct,getProductById,updateProductById,deleteProductById}= require('./controllers/product.controller')
//create User
const { callUserById,createUser, callUserData, updatecallById, deleteCallById } = require('./controllers/user.controller')
const app = express()
const port =3000
app.use(express.json())
//Seller
app.post("/seller",createSeller)
app.get("/seller",callSeller)
app.get("/seller/:id",getSellerById)
app.patch("/seller/:id",updateSellerById)
app.delete("/seller/:id",deleteSellerById)
//Product
app.post("/Product",createProduct)
app.get("/Product",callProduct)
app.get("/Product/:id",getProductById)
app.patch("/product/:id",updateProductById)
app.delete("/Product/:id",deleteProductById)
//User
app.post("/user",createUser)
app.get("/user",callUserData)
app.get("/user/:id",callUserById)
app.patch("/user/:id",updatecallById)
app.delete("/user/:id",deleteCallById)
app.listen(port,()=>{
console.log("send");
})