Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodegate

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodegate - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

modifiers/forwardedhost.js

2

entities/pipeline.js

@@ -13,3 +13,3 @@ /**

for (let i = 0; i < pipeline.length; i += 1) {
container = await pipeline[i](container); // eslint-disable-line no-await-in-loop
container = await pipeline[i](container, req); // eslint-disable-line no-await-in-loop
}

@@ -16,0 +16,0 @@ res.send(container.body);

@@ -10,2 +10,3 @@ /**

const filter = require('./filter');
const forwardedhost = require('./forwardedhost');
const waitfor = require('./waitfor');

@@ -16,3 +17,4 @@

filter,
forwardedhost,
waitfor,
};
{
"name": "nodegate",
"description": "API gateway made simple, fast and easy to configure.",
"version": "0.2.0",
"version": "0.3.0",
"author": "Julien Martin <martin.julien82@gmail.com>",

@@ -24,3 +24,3 @@ "license": "MIT",

"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.15.0",
"eslint-plugin-import": "^2.17.2",
"jest": "^24.7.1",

@@ -27,0 +27,0 @@ "nock": "^10.0.6",

@@ -273,2 +273,3 @@ ![nodegate](assets/images/logo-readme.png)

- [filter(properties)](#filterproperties)
- [forwardedhost()](#forwardedhost)
- [waitfor(method, url, test)](#waitformethod-url-test)

@@ -315,2 +316,15 @@

#### forwardedhost()
Add the the container headers the property `X-Forwarded-Host` with the value of the original request
header `host`.
_Example_
```js
const pipeline = [
forwardedhost(),
];
```
#### waitfor(method, url, test)

@@ -317,0 +331,0 @@

@@ -31,7 +31,13 @@ /**

const route = expressApp => (settings) => {
expressApp[settings.method.toLowerCase()](
settings.path,
executor(settings.pipeline),
);
const addRoute = expressApp => (routes) => {
let routesToAdd = routes;
if (!Array.isArray(routes)) {
routesToAdd = [routes];
}
routesToAdd.forEach((route) => {
expressApp[route.method.toLowerCase()](
route.path,
executor(route.pipeline),
);
});
};

@@ -48,3 +54,3 @@

app.route = route(expressApp);
app.route = addRoute(expressApp);

@@ -51,0 +57,0 @@ app.listen = expressApp.listen;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc