-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (29 loc) · 1.07 KB
/
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
31
32
33
34
35
36
37
38
const express = require('express')
const cookieParser = require('cookie-parser')
const morgan = require('morgan')
const cors = require('cors')
const skillsRouter = require('./routes/skills.route')
const tasksRouter = require('./routes/tasks.route')
const tasksSkillsRouter = require('./routes/taskXskill.route')
const skillsSearch = require('./routes/skill-search.route')
const tasksSearch = require('./routes/task-search-route')
const mailRouter = require('./routes/send-mail.route')
const pdfRouter = require('./routes/print-pdf.route')
require('dotenv').config()
const app = express()
app.use(morgan('dev'))
app.use(cookieParser())
app.use(express.json())
app.use(express.urlencoded({ extended: false }))
app.use(cors())
app.use('/api/skills', skillsRouter)
app.use('/api/tasks', tasksRouter)
app.use('/api/tasksxskills', tasksSkillsRouter)
app.use('/api/mail', mailRouter)
app.get('/api/health-check', async (req, res) => {
return res.status(200).json("ok")
})
const port = process.env.PORT || 3100
app.listen(port, () => {
console.log(`Server running on port ${port} ...`)
})