nock-mock-server
v1.0.0
Published
A simple mock server powered by nock
Downloads
129
Maintainers
Readme
Nock Mock Server
A simple mock server powered by nock.
Installation
Install the package using npm:
npm install nock-mock-server
Usage
Create a mock server instance and add mocks:
// index.js
const { NockMockServer } = require("nock-mock-server");
const PORT = 3000;
const nockServer = new NockMockServer();
nockServer.addMock((nockInstance) => {
nockInstance.get("/").reply(200, { message: "Hello World" });
});
nockServer.start(PORT, () => {
console.log("Nock server started");
});
Examples
You can find more examples in the examples directory.
License
This project is licensed under the MIT License. See the LICENSE file for details.