Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213141516171819202122
  1. const express = require('express')
  2. const app = express()
  3. const path = require('path')
  4. const port = process.env.PORT || 3000
  5. require('./database/mongoose')
  6. const userRouter = require('./routers/user')
  7. //const viewsPath = path.join(__dirname, '../templates/views')
  8. app.use(express.json())
  9. app.use(userRouter)
  10. app.get('/', (req, res) => {
  11. try {
  12. res.send('Wello Horld!')
  13. } catch(e) {
  14. res.status(500).send(e)
  15. }
  16. })
  17. app.listen(port, () => {
  18. console.log('Server is up on port ' + port)
  19. })