Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@mesosphere/mockserver
Advanced tools
A mockserver that allows you to mock XHR, long-polling XHR, server sent events and websocket connections
We provide two interfaces, a CLI for the fast and easy way to interact with the mock server and a programmatic API to give you the control over everything.
The CLI is entirely controlled via environment variables, here are the ones you may configure
PROXY_HOST_PORT
(required): determine where to send the requests no mock matches against to. E.g. "my-service.com:2342"MOCK_SEARCH_EXPRESSION
(required): glob to specify where to search for mocks. E.g. "./*/-mock.js"PORT
(optional): port of the mockserverYour mocks should be defined in Javascript files as named export:
// The name is important!
export const mocks = [
{
id: "my-first-mock",
request: (req, res) => {
// Same interface as express middlewares
res.status(200);
}
}
];
Please note that we import these files at start time of the mockserver.
import mockserver from "mockserver";
// Every option is required
const { port, close } = await mockserver({
port: 0, // zero means "choose your own"
proxyHost: "my-service",
proxyPort: 42,
mocks: [
{
id: "my-first-mock",
request: (req, res) => {
// Same interface as express middlewares
res.status(200);
}
}
]
});
npm install
npm start
npm run watch
Please run npm test
FAQs
A mockserver that allows you to mock XHR, long-polling XHR, server sent events and websocket connections
We found that @mesosphere/mockserver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 13 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.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.