text: "use strict";
  
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
  
  var _httpErrors = _interopRequireDefault(require("http-errors"));
  
  var _express = _interopRequireDefault(require("express"));
  
  var _path = _interopRequireDefault(require("path"));
  
  var _cookieParser = _interopRequireDefault(require("cookie-parser"));
  
  var _morgan = _interopRequireDefault(require("morgan"));
  
  var _index = _interopRequireDefault(require("./routes/index"));
  
  var _users = _interopRequireDefault(require("./routes/users"));
  
  var app = (0, _express["default"])();
  app.use(_express["default"].json()); // view engine setup
  
  app.set('views', _path["default"].join(__dirname, '../server/views'));
  app.set('view engine', 'jade');
  app.use((0, _morgan["default"])('dev'));
  app.use(_express["default"].json());
  app.use(_express["default"].urlencoded({
    extended: false
  }));
  app.use((0, _cookieParser["default"])());
  app.use(_express["default"]["static"](_path["default"].join(__dirname, '../public')));
  app.use('/', _index["default"]);
  app.use('/users', _users["default"]); // catch 404 and forward to error handler
  
  app.use(function (req, res, next) {
    next((0, _httpErrors["default"])(404));
  }); // 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 : {}; // render the error page
  
    res.status(err.status || 500);
    res.render('error');
  });
  module.exports = app;
  //# sourceMappingURL=app.js.map