- Created all Tests with Mocha: User + Todo tables

This commit is contained in:
Paolo Arena
2019-02-07 00:52:48 +01:00
parent 779bd1cb63
commit 87378fe732
10 changed files with 309 additions and 150 deletions

View File

@@ -1,11 +1,14 @@
var {User} = require('../models/user');
const tools = require('../tools/general');
var authenticate = (req, res, next) => {
var token = req.header('x-auth');
// console.log("TOKEN = " + token);
User.findByToken(token).then((user) => {
// tools.mylogshow('userid', user._id)
if (!user) {
return Promise.reject();
}