
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
rest-api-connector
Advanced tools
This is a utility for easy configure the rest api to a module. People who want to write a REST API node module, can use this for building one! Only config the rest url, invoke method (GET/POST/PUT/DELETE), and the field that the module will looks like, then the module help you to auto validate your input.
If you don't metter that the json string will disturb your code format. You can merge all code in single file like:
var api = require('rest-api-connector').api;
//Setup and compile the api node module
api.buildFromJson(
{ //define the api connection info
API_CFG: {
USERNAME: "your api username", //api password
PASSWORD: "your api password", //api username
BASE_URL: "http://123.123.123.123:123" //api url
}
},
{ //define the api definition
apiCall: {
url:"/service/:uuid",
method: "GET",
input: [
{ "name":"id", "value":"", "type":"string", "max":40, "nullable":false }
]
}
}
);
//This is where you use the api module
api.apiCall(uuid, function(e,r,d){
console.log(d);
});
If you want your user call a function that named: getUser(userid, callback) to use the api to get user. You only need to config a json like:
{
getUser: {
url:"/user/:userid",
method: "GET",
input: [{name:"userid", value:'', type:"string", max:40, nullable:false, skipcheck: true}],
output: { status: ['ERROR','SUCCESS'], msg: ""}
}
}
Then the rest-api-connector will auto generate a module called: getUser(userid, callback) for you. And it will export for other js to use.
If you want to see more configurations, see: Advance Configures
FAQs
Node.js REST API Connect Util
The npm package rest-api-connector receives a total of 20 weekly downloads. As such, rest-api-connector popularity was classified as not popular.
We found that rest-api-connector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.