text: let express = require('express');
  let path = require('path');
  let favicon = require('serve-favicon');
  let logger = require('morgan');
  let bodyParser = require('body-parser');
  
  let index = require('./routes/todo');
  
  let app = express();
  
  // uncomment after placing your favicon in /public
  app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
  app.use(logger('dev'));
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(express.static(path.join(__dirname, 'public')));
  
  app.use('/todo', index);
  
  // catch 404 and forward to error handler
  app.use(function(req, res, next) {
    let err = new Error('Not Found');
    err.status = 404;
    next(err);
  });
  
  // error handler
  app.use(function(err, req, res/*, next*/) {
    // set locals, only providing error in development
    res.locals.message = err.message;
    res.locals.error = req.app.get('env') === 'development' ? err : {};
  
    res.status(err.status || 500);
    res.end('error');
  });
  
  module.exports = app;
  