text: const express = require('express');
  const router = express.Router();
  const auth = require('../../middleware/auth');
  const { check, validationResult } = require('express-validator');
  
  const User = require('../../models/User');
  
  // @route    GET api/profile/me
  // @desc     Get current users profile
  // @access   Private
  router.get('/me', auth, async (req, res) => {
    try {
      const user = await User.findById(req.user.id).select(['name','email','phoneNumber','-_id']);
      
      if (!user) {
        return res.status(400).json({ msg: 'There is no profile for this user' });
      }
  
      res.json(user);
    } catch (err) {
      console.error(err.message);
      res.status(500).send('Server Error');
    }
  });
  
  
  module.exports = router;