api / co / es6 / generators / javascript / js / node / nodejs / passport / promise / q / rest / rest api / yield
Encadeamento de roteador expresso, adição de usuário REST API, nodejs
router.js const router = require(‘express’).Router();const User = require(‘./lib/user’);router.post(‘/api/users’, User.validateUser, User.addUser, User.sendValidationEmail, User.authenticateUser, function(req, res, next) { res.status(204).end(); }); lib / user.js const co = require(‘co’);const q = require(‘q’);const passport = …
Continuar lendo