express-gateway
Version:
A microservices API gateway built on top of ExpressJS
28 lines (26 loc) • 526 B
JavaScript
module.exports = function (client) {
const baseUrl = `scopes/`;
return {
create (scope) {
return client
.post(baseUrl)
.send({ scope })
.then(res => res.body);
},
remove (scope) {
return client
.del(baseUrl + scope)
.then(res => res.body);
},
info (scope) {
return client
.get(baseUrl + scope)
.then(res => res.body);
},
list () {
return client
.get(baseUrl)
.then(res => res.body);
}
};
};