-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
37 lines (27 loc) · 1.18 KB
/
server.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
const express = require("express");
require("./src/mongo/mongo");
const authRoute = require("./src/routes/adminRoutes/authRoute");
const addShopRoute = require("./src/routes/adminRoutes/addshop.route");
const updateShopRoute = require("./src/routes/adminRoutes/updateShop.route");
const getShopRoute = require("./src/routes/adminRoutes/getShop.route");
const serveImageRoute = require("./src/routes/serveImage.route");
const RemoveShopRoute = require("./src/routes/adminRoutes/removeShop.route");
const userAuthRoute = require("./src/routes/userRoutes/userauth.route");
const getRoute = require("./src/routes/userRoutes/get.route");
const app = express();
const PORT = process.env.PORT;
app.listen(PORT, () => {
console.log("Listening on port " + PORT);
});
app.use(express.json())
app.get("/", (req, res) => {
res.json({ message: "Connected to quick-shop-admin-server" });
});
app.use("/api/admin/auth",authRoute);
app.use("/api/admin/shop",addShopRoute);
app.use("/api/admin/shop",updateShopRoute);
app.use("/api/admin/shop",RemoveShopRoute);
app.use("/api/admin/get",getShopRoute);
app.use("/api/auth",userAuthRoute);
app.use("/api/serveImage/",serveImageRoute);
app.use("/api/get/",getRoute);