title: Express route in controller not resolved
body: <p>I'm using express 4.16.3 and trying to make sense of why one request to a controller works and a request doesn't.</p>
  
  <p>in my server.js i've got the following. There's no semi-colons because used prettier beforehand.</p>
  
  <pre><code>import express from 'express'
  import bodyParser from 'body-parser'
  import cors from 'cors'
  import PriceCheckerController from './controllers/PriceChecker'
  import PersonalLibraryController from './controllers/PersonalLibrary'
  
  const app = express()
  app.set('port', process.env.PORT || 5000)
  app.use(bodyParser.json())
  app.use(bodyParser.urlencoded({extended: true}))
  app.use(cors())
  // routes definition
  app.use('/api/books',PersonalLibraryController) // this does not
  app.use('/api/stock-prices', PriceCheckerController) // this works
  //
  app.listen(app.get('port'), error =&gt; {
    if (error) {
     logger.error(`error fcc-isqa:${error}`)
    } else {
     logger.info(`fcc-isqa is running on port ${app.get('port')}`)
    }
  })
  export default app
  </code></pre>
  
  <p>In PriceCheckerController i've implemented it like so.</p>
  
  <pre><code>import 'babel-polyfill' // mocha required
  import express from 'express'
  import logger from '../logger'
  
  const PriceCheckerController = express.Router()
  PriceCheckerController.use((req, res, next) =&gt; {
    logger.info(
      `date=&gt;${new Date()}\n method=&gt;${req.method}nsender:${req.ip}`
    )
  })
  PriceCheckerController.get('/', async (req, res) =&gt; {
     return res.status(200).json({message:'soon'})
  })
  export default PriceCheckerController
  </code></pre>
  
  <p>In PersonalLibraryController i've implemented it like so</p>
  
  <pre><code>import 'babel-polyfill'
  import express from 'express'
  import logger from '../logger'
  
  
  const PersonalLibraryController = express.Router()
  PersonalLibraryController.use((req,res,next)=&gt;{
     logger.info(
      `library date=&gt;${
        new Date()}method=&gt;${req.method}url=&gt;${req.baseUrl}${req.path}`
      )
  })
  PersonalLibraryController.route('/test')
  .get(async (req, res) =&gt; {
      return res.status(200).json({message: 'get soon'})
  })
  .post(async (req,res)=&gt;{
      return res.status(200).json({message: 'post soon'})
  })
  export default PersonalLibraryController
  </code></pre>
  
  <p>A request to /api/stock-prices returns ok with message soon.
  A request to /api/books/test is logged by the middleware but a response is not sent back. It eventually gives a timeout </p>
  
  <p>Can anyone give me any insights/ help in understanding what is the problem and how to fix it?
  Thanks in advance.</p>