UNPKG

express-gateway

Version:

A microservices API gateway built on top of ExpressJS

18 lines (17 loc) 327 B
module.exports = function (client) { const baseUrl = 'schemas/'; return { list (type = '', name = '') { let url = baseUrl; if (type) { url += `/${type}`; } if (name) { url += `/${name}`; } return client .get(url) .then(res => res.body); } }; };