Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
api-server-sim
Advanced tools
Readme
This Simulator allows for a Test Automation System to control and observe the universe of a Backend system that depends upon external API services. The two main features are:
First, install the library:
Install the required libraries.
npm install api-server-sim
Then, create a JS file containing the next code, named sim.js for example. Here we will configure and start an API server as specified in a list of Excel files located in your NodeJS project.
const ExcelServer = require("api-server-sim");
// Parameters
const files = ['./endpoints.xlsx'];
const port = 3000;
const validations = {
apiSpec: undefined,
validateRequests: false,
validateResponses: false
};
// start the server without validating open api spec
const sim = new ExcelServer({ files, port }, validations);
sim.run();
The endpoints.xlsx file contains the REST API endpoints to run. For example, the Excel can contain a table such as the next one as a "GET Hello World" endpoint:
scenario | method | url | headers | body | query | status | response |
---|---|---|---|---|---|---|---|
Hello World | get | /hello | 200 | { "message": "Hello World" }- |
The headers, body, query and response columns must be valid json objects or paths to a valid json file.
Finally, execute the sim.js file, by running node:
node sim.js
... or creating a script in your package.json and running with NPM:
npm run sim
npm install
npm run start
After running the sample server provided in this library, run the sample Jasmine tests. Every test should pass.
npm test
This project is licensed under the MIT License - see the license.txt file for details.
Feel free to report suggestions and issues! Thanks.
FAQs
Api Server Simulator so you can mock api Rest services easily. Also, find an integrated Spy on api calls and an SMTP Server to catch emails.
The npm package api-server-sim receives a total of 32 weekly downloads. As such, api-server-sim popularity was classified as not popular.
We found that api-server-sim demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.