var Response = require('../data/response');

var express = require('express');
var router = express.Router();
var models = require('../models/index');
var project = require('../middlewares/project');

/* GET home page. */
router.get('/', function (req, res) {
    res.render('index');
});

router.post('/', function (req, res) {
    // the principal email object
    var principalEmail = req.user.emails[0];
    var msg = 'Hi ' + req.user.username + ' your principal email is ' + principalEmail.email;
    res.json(JSON.stringify(new Response(200, msg, {})));
});

router.post('/:space/:project',
    project.project, project.isStatus, project.isReady, project.validIp,
    project.reqPerhour, project.limit, project.hasMetric,
    project.validMetrics, project.evalMetrics,
    project.saveMetrics, project.notif,
    function (req, res) {
        res.json(JSON.stringify(new Response(200, 'all is fine', {})));
    });

module.exports = router;

@@ -720,20 +720,16 @@
 sMetric,
-%0A   
  project
@@ -734,32 +734,36 @@
 ct.validMetrics,
+%0A   
  project.evalMet
@@ -759,36 +759,32 @@
 ect.evalMetrics,
-%0A   
  project.saveMet

Add my first mongoose model.