title: How to configure express router along with ES6?
body: <p>I have the following code for an router file in express. </p>
  
  <pre><code>import express from 'express';
  import  _  from 'lodash';
  import { Devices, OwlElecMonitors } from '../models/';
  
  var router = express.Router();
  
  router.get('/api/devices/:id',function (req, res) {
      console.log(req);                   
      Devices.getDevicesByUserId({ userId: req.params.id },function(err, resp) {
          res.send(resp);
      });
  });
  
  export default router;
  </code></pre>
  
  <p>and I am trying to import it into the main file using the following code </p>
  
  <pre><code>import api from './routes';
  app.use('/api', api);
  </code></pre>
  
  <p>But the code returns a 404 error. Where am I going wrong ? What changes do I need to make for this to work ?</p>