title: cannot GET / express.js routing
body: <p>I am at the early stages of a simple tasks manager that I want to build with the MEAN Stack.
  I can figure/resolve a simple routing issue. I don't see any error message in the terminal or console except for the 404 client error.</p>
  
  <p>the root path is ok. I get a response back
  I use html docs to render the ui for both.</p>
  
  <p>this is how I have set up my <code>server.js</code></p>
  
  <pre><code>var express = require('express')
  var path = require('path')
  var bodyParser = require('body-parser')
  
  var index = require('./routes/index');
  var tasks = require('./routes/tasks');
  var app = express();
  
  const port = '3456'
  
  
  app.use('/', index)
  app.use('api', tasks) &lt;= HERE
  
  //view engine
  app.set('views', path.join(__dirname, 'views'))
  app.set('view engine', 'ejs')
  app.engine('html', require('ejs').renderFile);
  
  //static folder
  app.use(express.static(path.join(__dirname, 'client')))
  app.use(bodyParser.json())
  app.use(bodyParser.urlencoded({extended: false}))
  
  
  
  app.listen(port, function() {
      console.log('Starting the server at port'  + port );
  })
  </code></pre>
  
  <p><strong>tasks.js</strong></p>
  
  <p>to render the template at the set route</p>
  
  <pre><code>var express = require('express')
  var router = express.Router();
  var mongojs = require('mongojs');
  var db = mongojs('mongodb://sandy:cookie2080@ds147304.mlab.com:47304/tasklists_21092017', ['tasks'])
  
  router.get('/tasks', function(req, res, next) {
      res.send('api')
      res.render('tasks.html')
      db.tasks.find(function(err, tasks){
          if (err) {
              res.send('error message ' + err)
          }
  
          res.json(tasks)
      })
  })
  
  module.exports = router;
  </code></pre>
  
  <p>and, <strong>index.js</strong> fyi</p>
  
  <pre><code>var express = require('express')
  var router = express.Router();
  
  router.get('/', function(req, res, next) {
      res.render('index.html')
  })
  
  module.exports = router;
  </code></pre>
  
  <p><strong>screenshot at the link below of the 404 error in browser after starting server on port 3456</strong></p>
  
  <p><a href="https://i.stack.imgur.com/FxNe6.png" rel="nofollow noreferrer">404 error - screenshot</a></p>
  
  <p>thanks for the help. I am sure it can be a little detail. it is very hard to debug though.</p>