express-api-gateway
Version:
Simples api gateway usando expressjs
28 lines (27 loc) • 715 B
JavaScript
import proxy from "express-http-proxy";
/**
* This API calculates the average of a list of numbers.
*
* @param list - the array of input numbers
* @returns the arithmetic mean, or 0 if `list` is an empty array
*
* @internal
*/
var ApiGateway = /** @class */ (function () {
function ApiGateway(app) {
this.app = app;
}
ApiGateway.prototype.setPath = function (path) {
this.path = path;
return this;
};
ApiGateway.prototype.setUrl = function (url) {
this.url = url;
return this;
};
ApiGateway.prototype.builder = function () {
this.app.use(this.path, proxy(this.url));
};
return ApiGateway;
}());
module.exports = ApiGateway;