-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
36 lines (27 loc) · 1.15 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
const express = require('express');
const routes = require('./routes/routes.js');
const accountRoutes = require('./routes/accountRoutes.js');
const mainRoutes = require('./routes/mainRoutes.js');
const groupRoutes = require('./routes/groupRoutes.js');
const ocrRoutes = require('./routes/OCRroutes.js');
const groupstudyRoutes = require("./routes/groupstudyRoutes.js")
const forumRoutes = require("./routes/forumRoutes.js")
const bodyParser = require("body-parser");
const app = express();
app.use(bodyParser.json({ limit: '50mb' }))
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true, parameterLimit: 50000 }))
app.use(express.json());
app.use(express.raw({ type: 'application/json' }));
app.use(express.static('public'));
// Redirect from the root URL to /account/login.html
app.get('/', (req, res) => {
res.redirect('/account/login.html');
});
app.use('/', routes)
app.use('/account', accountRoutes)
app.use('/main', mainRoutes)
app.use('/groups', groupRoutes)
app.use('/ocr', ocrRoutes); // Add the endpoint for flashcards
app.use('/study', groupstudyRoutes); // Add the endpoint for flashcards
app.use('/forum', forumRoutes)
module.exports = app;