-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
51 lines (24 loc) · 843 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const express= require("express");
const mongoose = require('mongoose');
require("dotenv").config()
const userRoute = require('./routes/userRoute')
const buyerRoute = require('./routes/buyerRoute')
PORT= process.env.PORT;
const db = require("./middleware/db");
const app = express()
app.use(express.json())
app.use(express.urlencoded({extended:true}));
db.connectToMongoDB();
app.get('/', (req, res) => {
res.json({
status: 'status',
message: 'Visit the following link(s) for details about usage',
link: 'https://github.com/tobisupreme/blogolicious#usage',
readme: 'https://github.com/tobisupreme/blogolicious#readme',
})
})
app.use('/api/vd/user', userRoute)
app.use('/api/vd/buyer', buyerRoute)
app.listen(PORT, () => {
console.log(`Server is listening at PORT ${PORT}`)
})