-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.js
35 lines (27 loc) · 929 Bytes
/
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
require("dotenv").config({ path: "config/config.env" })
const express = require("express")
const app = express()
const dotenv = require('dotenv')
const PORT = process.env.PORT || 5000
app.use(express.json())
const connectDB = require('./config/db')
dotenv.config({ path: './config/config.env' })
connectDB()
const bodyParser = require("body-parser")
const cookieParser = require("cookie-parser")
app.use(cookieParser())
app.use(express.json())
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
// app.use("/api", product, cart)
const order = require("./routes/Order.route")
const categories = require("./routes/categories")
const User = require("./routes/User")
const product = require("./routes/product")
const cart = require('./routes/cart')
app.use("/categories", categories)
app.use("/User", User)
app.use(order)
app.listen(PORT, () => {
console.log(`Server has started at ${PORT}`)
})