-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
35 lines (27 loc) · 1017 Bytes
/
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
const express = require('express')
const mongoose = require('mongoose')
const UserRouter = require('./Router/UserRoute')
const OrderRouter = require('./Router/OrderRoute')
const ProductRouter = require('./Router/ProductRoute')
const CustomerRouter = require('./Router/customerRoute')
const SellerRouter = require('./Router/sellerRoute')
const AdminRouter = require('./Router/adminRoute')
const app = express()
require('dotenv').config()
app.use(express.json())
const MongoDB = "mongodb+srv://ecomm:[email protected]/?retryWrites=true&w=majority"
//const MongoDBString =
mongoose.connect(MongoDB)
.then((c)=> {
app.listen(3003, () => {
console.log('connected to database')
console.log('server running on port 3003')
})
})
//blob storage
app.use('/user', UserRouter)
app.use('/order', OrderRouter)
app.use('/product', ProductRouter)
app.use('/customer', CustomerRouter)
app.use('/seller', SellerRouter)
//app.use('/admin', AdminRouter)