-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
32 lines (22 loc) · 876 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
const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
const app = express();
app.use(bodyParser.json());
app.use(cors());
const userRoutes = require('./routes/users');
const imageRoutes = require('./routes/images');
const messageRoutes = require('./routes/messages');
const conversationRoutes = require('./routes/conversations');
const conversationMEmbersRoutes = require('./routes/conversation_members')
app.use('/api/users', userRoutes);
app.use('/api/images', imageRoutes);
app.use('/api/messages', messageRoutes);
app.use('/api/conversations', conversationRoutes);
app.use('/api/conversations-members', conversationMEmbersRoutes);
//!! Start the server
const PORT = process.env.PORT || 8800;
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
module.exports = app;