title: 5000/groups/create works but 5000/groups/:id is coming back with 404
body: <p>My route to 5000/groups/:id is coming back with 404 not found.</p>
  <p>When I do a delete request to the same route, everything works fine.</p>
  <p>Even if i just visit 5000/groups/:id ,  I still see the cannot GET /groups/:id</p>
  <p>In the frontend I am sending the request with axios from a react app. On the frontend I am getting the id to show in the url but when my app triggers the get request to http://localhost:5000/groups/:id it is a cannot get response, however a delete request to the same route works fine.</p>
  <p>Again the frontend is dispatching fine its just that the route seems to be non existent when doing a get request?</p>
  <p>Here is my frontend action.js</p>
  <pre><code>export const groupById = (GroupId, dispatch) =&gt; {
           try{
           console.log(GroupId)
          return async function(dispatch) {
                  dispatch({type: GROUP_DETAILS_REQUEST})
                  const {data} = await axios
                  .get(`http://localhost:5000/groups/${GroupId}`)
                  .then(res =&gt; console.log(res))
                  
          }
         
  } catch(error) {
                         dispatch({type: GROUP_DETAILS_FAIL,
                         payload:
                         error.message &amp;&amp; error.response.data.message 
                         ? error.response.data.message :
                         error.message
                         })
                         
                  }
          }
  </code></pre>
  <p>Here is my index.js file</p>
  <pre><code>const express = require('express');
  const mongoose = require('mongoose');
  const cookieSession = require('cookie-session');
  const passport = require('passport');
  const bodyParser = require('body-parser')
  const keys = require('./config/keys');
  const cors = require('cors')
  require(&quot;dotenv&quot;).config();
  require('./models/GoogleUserModel'); // the user model must be placed before this services passport// this must be ran after requiring model bcuz this needs the model. ORDER
  require('./models/UserModel');
  require('./models/Contact');
  require('./models/Template');
  require('./models/UserProfile')
  require('./services/passport');
  
  const corsOptions = {
      origin:&quot;http://localhost:3000&quot;, 
      credentials: true,      //access-control-allow-credentials:true
      optionSuccessStatus:200
  }
  const app = express();
  
  app.use(cors(corsOptions))
  
  mongoose.Promise = global.Promise;
  mongoose.connect(keys.mongoURI, {
      useNewUrlParser: true,
      useCreateIndex: true,
      useUnifiedTopology: true
  })
  mongoose.connection.on('error', () =&gt; {
      throw new Error (`unable to connect to database: ${keys.mongoURI}`)
  });
  
  
  app.use(bodyParser.json({limit: '10mb'}))
  app.use(express.urlencoded( { extended: true }))
  app.use(
      cookieSession({
          maxAge: 30 * 24 * 60 * 60 * 1000,
          keys: [keys.cookieKey]
      })
  )
  app.use(passport.initialize());
  app.use(passport.session());
  
  
  require('./routes/googleAuthRoutes')(app);
  require('./routes/userRoutes')(app);
  require('./routes/messageRoutes')(app)
  // we are passing in the route functions, THEN calling the functions with the app object
  
  
  
  app.use((err, req, res, next) =&gt; {
      if (err.name === 'UnauthorizedError') {
          res.status(401).json({&quot;error&quot; : err.name + &quot;: &quot; + err.message})
      } else if (err) {
          res.status(400).json({&quot;error&quot; : err.name + &quot;: &quot; + err.message})
          console.log(err)
      }
  })
  const PORT = process.env.PORT || 5000;
  app.listen(PORT);
  
  </code></pre>
  <p>Here is my userRoutes.js</p>
  <pre><code>const express = require( 'express')
  const userCtrl = require( '../controllers/userController')
  const authCtrl = require('../controllers/authController')
  const cors = require('cors');
  const requireLogin = require('../middlewares/requireLogin')
  const router = express.Router();
  const bodyParser = require('body-parser');
  
  
  module.exports = (router) =&gt; {
      
  router.route('/api/find-a-number').post(userCtrl.findANumber)
  
  router.route('/contacts/create').post(userCtrl.createContact).get(userCtrl.listContacts)
  router.route('/contacts/:id').get(userCtrl.contactByID).delete(userCtrl.deleteContact).put(userCtrl.updateContact)
  
  router.route('/templates/create').post(userCtrl.createTemplate).get(userCtrl.listTemplate)
  router.route('/templates/:id').delete(userCtrl.deleteTemplate)
  
  router.route('/groups/create').get(userCtrl.listGroup).post(userCtrl.createGroup)
  router.route('/groups/:id').get(userCtrl.groupById).delete(userCtrl.deleteGroup)
  
  router.route('/fields/create').get(userCtrl.listField).post(userCtrl.createField)
  router.route('/fields/:id').delete(userCtrl.deleteField).put(userCtrl.updateField)
  router.route('/fields').put(userCtrl.updateField)
  
  router.route('/files/create').get(userCtrl.listFiles).post(userCtrl.createFiles)
  router.route('/files/:id').delete(userCtrl.deleteFiles)
  
  router.route('/auth/signin').post(authCtrl.signin)
  
  router.route('/auth/signout').get(authCtrl.signout)
  
  router.route('/api/users').get(userCtrl.list).post(userCtrl.create)
  
  router.route('/api/users/:userId').get(userCtrl.read).put(userCtrl.update).delete(userCtrl.remove)
  
  router.route('/profile/update').post(userCtrl.updateProfile).get(userCtrl.getProfile)
  
  router.param('userId', userCtrl.userByID)
  
  }
  </code></pre>
  <p>here is my userController.js</p>
  <pre><code>const mongoose = require('mongoose');
  const extend = require('lodash');
  const keys = require('../config/keys');
  const User = require('../models/UserModel');
  const Template = require('../models/Template');
  const Contact = require('../models/Contact');
  const Group = require('../models/GroupModel');
  const Field = require('../models/FieldModel');
  const Files = require('../models/ImportedFilesModel');
  const ProfileUpdater = require('../models/UserProfile');
  const passport = require('passport');
  const dbErrorHandler = require( '../helpers/dbErrorHandler');
  
  
   const groupById = async (req, res, next, id) =&gt; {
              // when I put a console.log here nothing is logged.
              try {
                 
                  let group = await Group.findById(id)
                  if(!group)
                  return res.status(400).json({error: &quot;Group not found&quot;})
                  
                  res.json(group)
                  next()
              } catch(err) {
                  return res.status('400').json({
                      error: 'could not retrieve user'
                  })
              }
          }
  
   module.exports =  { 
            
              groupById        
  </code></pre>