Skip to content

Commit

Permalink
refactor: remove lodash.foreach
Browse files Browse the repository at this point in the history
  • Loading branch information
sinedied committed Dec 6, 2022
1 parent 9a4aaa0 commit f39f185
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import process from 'node:process';
import express from 'express';
import proxy from 'express-http-proxy';
import rewrite from 'express-urlrewrite';
import foreach from 'lodash.foreach';
import yaml from 'js-yaml';

export default function gateway(configPath) {
Expand All @@ -26,7 +25,7 @@ export default function gateway(configPath) {
next(error);
}

foreach(config.services, (service, name) => {
for (const [name, service] of Object.entries(config.services)) {
console.log(`service: ${name} at ${service.path}`);
const routeConfig = [
service.path,
Expand All @@ -35,7 +34,7 @@ export default function gateway(configPath) {
proxy(service.url),
];
app.all(...routeConfig.filter(Boolean));
});
}

function showAddress(type) {
const bound = this[type].address();
Expand Down
6 changes: 0 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"express-http-proxy": "^1.6.2",
"express-urlrewrite": "^2.0.0",
"js-yaml": "^4.1.0",
"lodash.foreach": "^4.5.0",
"minimist": "^1.2.5"
},
"devDependencies": {
Expand Down

0 comments on commit f39f185

Please sign in to comment.