2020-02-23 21:53:38 +00:00
|
|
|
const express = require('express')
|
|
|
|
require('./db/mongoose')
|
2020-02-24 01:16:01 +00:00
|
|
|
const userRouter = require('./routers/user')
|
|
|
|
const taskRouter = require('./routers/task')
|
2020-02-23 21:53:38 +00:00
|
|
|
|
|
|
|
const app = express()
|
|
|
|
const port = process.env.PORT || 4200
|
|
|
|
|
|
|
|
app.use(express.json())
|
2020-02-24 01:16:01 +00:00
|
|
|
app.use(userRouter)
|
|
|
|
app.use(taskRouter)
|
2020-02-24 00:45:13 +00:00
|
|
|
|
2020-02-23 21:53:38 +00:00
|
|
|
app.listen(port, () => {
|
|
|
|
console.log('Server is up on port ' + port)
|
|
|
|
})
|