-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
32 lines (29 loc) · 1.17 KB
/
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
// app.js
const express = require('express');
const cors = require('cors');
const usersRouter = require('./routes/usersRouter');
const postsRouter = require('./routes/postsRouter');
const commentsRouter = require('./routes/commentsRouter');
const likesRouter = require('./routes/likesRouter');
const postImagesRouter = require('./routes/postImagesRouter');
const tagsRouter = require('./routes/tagsRouter');
const postTagsRouter = require('./routes/postTagsRouter');
const messagesRouter = require('./routes/messagesRouter');
const notificationsRouter = require('./routes/notificationsRouter');
const followersRouter = require('./routes/followersRouter');
const loginRouter = require('./routes/loginRouter');
const app = express();
app.use(cors());
app.use(express.json());
app.use('/users', usersRouter);
app.use('/posts', postsRouter);
app.use('/comments', commentsRouter);
app.use('/likes', likesRouter);
app.use('/post-images', postImagesRouter);
app.use('/tags', tagsRouter);
app.use('/post-tags', postTagsRouter);
app.use('/messages', messagesRouter);
app.use('/notifications', notificationsRouter);
app.use('/followers', followersRouter);
app.use('/login', loginRouter);
module.exports = app;