text: require('dotenv').config()
  const express = require('express')
  const mongoose = require('mongoose')
  const cors = require('cors')
  const cookieParser = require('cookie-parser')
  
  const app = express()
  app.use(express.json())
  app.use(cookieParser())
  app.use(cors())
  
  // Routes
  app.use('/user', require('./routers/userRouter'))
  app.use('/products', require('./routers/productCarRouter'))
  app.use('/products', require('./routers/productHouseRouter'))
  app.use('/products', require('./routers/productCellPhoneRouter'))
  app.use('/products', require('./routers/productTravelRouter'))
  
  // Connect to mongodb
  const URI = process.env.MONGODB_URL
  mongoose.connect(
    URI,
    {
      useCreateIndex: true,
      useFindAndModify: false,
      useNewUrlParser: true,
      useUnifiedTopology: true,
    },
    (err) => {
      if (err) throw err
      console.log('Connected to MongoDB')
    }
  )
  
  const PORT = process.env.PORT || 5000
  app.listen(PORT, () => {
    console.log('Server is running on port', PORT)
  })
  