
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
pipa-gateway
Advanced tools
A NodeJS module to help you create an API Gateway in an easy way.
The concept of PIPA GATEWAY is similar to PipaJS, to enable developer to create an orchestrator or an API Gateway or a proxy in easy way.
$ npm install pipa-gateway
var express = require('express')
var app = express()
var PipaGateway = require('pipa-gateway');
// PipaGateway
// @param object Express app
// @param string File json config
// @param string Middleware folder
var pipaGateway = new PipaGateway(app, { configPath: 'config.json', middlewarePath: 'middleware' });
pipaGateway.open();
app.listen(9000);
There are 3 features in pipa gateway, proxy
, parallel
and chain
.
Proxy
will forward your request to services.
{
"GET /users": {
"type": "proxy",
"service":
{
"name": "users",
"url": "https://jsonplaceholder.typicode.com/users"
}
},
"GET /user/:id": {
"type": "proxy",
"middlewares":["Auth.ensureAuth"],
"service":
{
"name": "user",
"url": "https://jsonplaceholder.typicode.com/users/:id"
}
}
}
Parallel
will request parallel to multilple services.
{
"GET /parallel": {
"type": "parallel",
"services": [
{
"name": "user",
"url": "https://jsonplaceholder.typicode.com/users"
},
{
"name": "post",
"url": "https://jsonplaceholder.typicode.com/posts"
}
]
}
}
Chain
will request chain to multiple services, the next request will process after previous request successfully and can set parameter to the next request based on result on previous request.
{
"GET /chain/:id": {
"type": "chain",
"services": [
{
"name": "user",
"url": "https://jsonplaceholder.typicode.com/users/:id"
},
{
"name": "post",
"url": "https://jsonplaceholder.typicode.com/posts?userId={user.id}",
"body":{
"userId":"{user.id}"
}
}
]
}
}
You can try to run the code example in example
folder.
FAQs
A NodeJS module to help you create an API Gateway in an easy way.
The npm package pipa-gateway receives a total of 0 weekly downloads. As such, pipa-gateway popularity was classified as not popular.
We found that pipa-gateway demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.