-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
60 lines (53 loc) · 1.88 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const express = require('express');
const app = express();
const port = 3002;
const cors = require('cors');
const Signup = require('./Routes/Signup');
const upload = require('./Routes/Middleware/upload');
const connectToMongo = require('./connectToMongo');
const AutoSignin = require('./Routes/AutoSignin');
const GenOtp = require('./Routes/GenOtp');
const Verify = require('./Routes/Verify');
const AddFriend = require('./Routes/AddFriend');
const AllFriends = require('./Routes/AllFriends');
const GetAllMessages = require('./Routes/GetAllMessages');
const AllUsers = require('./Routes/AllUsers');
const OnlineUsers = require('./Routes/OnlineUsers');
const UpdateNotification = require('./Routes/UpdateNotification');
const CheckUnReadMSG = require('./Routes/CheckUnReadMSG');
const UpdatePass = require('./Routes/UpdatePass');
const VerifyAuthToken = require('./Routes/VerifyAuthToken');
// const imageSc = require('./Schema/imageSc');
// const upload = multer({
// dest: 'Public/',
// filename: 'sss.jpg',
// });
app.use(express.static('public'));
app.use(express.urlencoded({ extended: false }));
app.use(express.json());
app.use(cors());
connectToMongo();
app.post('/', (req, res) => {
res.send('ChatVerse v1');
});
app.get('/', (req, res) => {
res.send('ChatVerse v1');
});
app.post('/profile', upload.single('uploaded_file'), ((req, res) => {
res.send('hello');
}));
app.use('/auth', Signup);
app.use('/auth/verify', Verify);
app.use('/auth/genotp', GenOtp);
app.use('/auto', AutoSignin);
app.use('/addfriend', AddFriend);
app.use('/allmessages', GetAllMessages);
app.use('/allfriends', AllFriends);
app.use('/allusers', AllUsers);
app.use('/onlineusers', OnlineUsers);
app.use('/updatenotifID', UpdateNotification); // Used to update notification id
app.use('/checkunreadmsg', CheckUnReadMSG);
app.use('/updatePass', UpdatePass);
app.use('/VerifyAuth', VerifyAuthToken);
app.listen(port, () => {
});