-
Notifications
You must be signed in to change notification settings - Fork 4
/
app.js
executable file
·65 lines (50 loc) · 1.55 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
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
61
62
63
64
65
require('dotenv').config();
const express = require('express');
// const app = express();
const { app } = require('./appInitialization');
const router = express.Router();
const bodyParser = require('body-parser');
const { db } = require("./database/models");
const fileUpload = require('express-fileupload');
const { io } = require('./socketIo');
app.use(fileUpload({
limits: { fileSize: 50 * 1024 * 1024 },
}));
app.use(bodyParser.json({ type: 'application/json'}));
//////////////
// WebSocket /
//////////////
///////////////
/// Routes ////
///////////////
const images = require('./routes/images');
const textToSpeech = require('./routes/text-to-speech.js');
const collections = require('./routes/collections');
const collectionItems = require('./routes/collectionItems');
const auth = require('./routes/auth');
const user = require('./routes/user');
const speechToText = require('./routes/speech-to-text');
const buddies = require('./routes/buddies');
const messages = require('./routes/messages');
const requests = require('./routes/requests');
///////////////
app.use('/images', images);
app.use('/texttospeech', textToSpeech);
app.use('/collections', collections);
app.use('/collectionItems', collectionItems);
app.use('/auth', auth);
app.use('/user', user);
app.use('/upload', speechToText);
app.use('/buddies', buddies);
app.use('/messages', messages);
app.use('/requests', requests);
///////////////
/**
* returns all languages
*/
app.get('/languages', (req, res) => {
db.getAllLanguages()
.then(languages => {
res.json(languages);
})
})