UNPKG

express-gateway

Version:

A microservices API gateway built on top of ExpressJS

13 lines (11 loc) 359 B
const userService = require('../../services/consumers/user.service'); const appService = require('../../services/consumers/application.service'); module.exports = function findConsumer (id) { return userService.findByUsernameOrId(id) .then(user => { if (user) { return user; } return appService.findByNameOrId(id); }); };