2023-03-31 18:56:39 +04:00
|
|
|
const express = require('express')
|
|
|
|
|
|
|
|
const abiturRouter = require('./routes/abitur.routes')
|
2023-03-31 23:19:54 +04:00
|
|
|
const examResultRouter = require('./routes/examresult.routes')
|
|
|
|
const specializationRouter = require('./routes/specialization.routes')
|
|
|
|
const educationFormRouter = require('./routes/educationform.routes')
|
|
|
|
const requestRouter = require('./routes/request.routes')
|
|
|
|
const request_examresultRouter = require('./routes/request_examresult.routes')
|
|
|
|
const enrollmentRouter = require('./routes/enrollment.routes')
|
2023-03-31 18:56:39 +04:00
|
|
|
|
|
|
|
const PORT = process.env.PORT || 8080
|
|
|
|
|
|
|
|
const app = express()
|
|
|
|
|
2023-04-03 01:00:37 +04:00
|
|
|
app.use(function(req, res, next) {
|
|
|
|
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
|
|
res.header("Access-Control-Allow-Methods", "GET, PUT, POST, DELETE");
|
|
|
|
res.setHeader('Access-Control-Allow-Headers', 'origin, content-type, accept');
|
|
|
|
next();
|
|
|
|
});
|
|
|
|
|
2023-03-31 18:56:39 +04:00
|
|
|
app.use(express.json())
|
|
|
|
app.use('/api', abiturRouter)
|
2023-03-31 23:19:54 +04:00
|
|
|
app.use('/api', examResultRouter)
|
|
|
|
app.use('/api', specializationRouter)
|
|
|
|
app.use('/api', educationFormRouter)
|
|
|
|
app.use('/api', requestRouter)
|
|
|
|
app.use('/api', request_examresultRouter)
|
|
|
|
app.use('/api', enrollmentRouter)
|
|
|
|
|
2023-03-31 18:56:39 +04:00
|
|
|
|
|
|
|
app.listen(PORT, () => console.log('server started on port ' + PORT))
|