forked from ruturajkanake/predicting-students-attentiveness
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
30 lines (23 loc) · 889 Bytes
/
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
const express = require('express');
const morgan = require('morgan');
const bodyParser = require('body-parser');
require('./src/db/mongoose');
const studentRouter = require('./src/routes/student');
const teacherRouter = require('./src/routes/teacher');
const subjectRouter = require('./src/routes/subject');
const lectureRouter = require('./src/routes/lecture');
const recordsRouter = require('./src/routes/records');
const app = express();
const port = process.env.PORT || 5000 ;
app.use(express.json());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(morgan('tiny'));
app.use('/student', studentRouter);
app.use('/teacher', teacherRouter);
app.use('/subject', subjectRouter);
app.use('/lecture', lectureRouter);
app.use('/records', recordsRouter);
app.listen(port, () => {
console.log(`Express server started at port: ${port}.` );
});