forked from vasukomuravelli/Flipkart_Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
27 lines (19 loc) · 777 Bytes
/
index.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
const express = require("express");
const cors = require("cors");
const ProductController = require("./controllers/product.controller");
const CartController = require("./controllers/cart.controller");
const UserController = require("./controllers/user.controller");
const wishlistController = require("./controllers/wishlist.controller");
const {register,login} = require("./controllers/auth.controller");
const app = express();
app.use(cors());
app.use(express.json());
var distDir = __dirname + "/dist/";
app.use(express.static(distDir));
app.post("/register",register);
app.post("/login",login);
app.use("/products",ProductController);
app.use("/cart",CartController);
app.use("/wishlist",wishlistController);
app.use("/user",UserController);
module.exports = app;