https://github.com/sadabnepal/mountebank-api-mock
Service virtualization example using Mountebank to mock REST APIs and simulate backend services for testing and development.
https://github.com/sadabnepal/mountebank-api-mock
api-mock api-mocking api-testing mock mock-server mountebank service-virtualization stub stubs testing-tools
Last synced: 1 day ago
JSON representation
Service virtualization example using Mountebank to mock REST APIs and simulate backend services for testing and development.
- Host: GitHub
- URL: https://github.com/sadabnepal/mountebank-api-mock
- Owner: sadabnepal
- Created: 2024-03-10T12:39:26.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2026-03-24T10:32:02.000Z (2 months ago)
- Last Synced: 2026-03-25T13:09:52.610Z (2 months ago)
- Topics: api-mock, api-mocking, api-testing, mock, mock-server, mountebank, service-virtualization, stub, stubs, testing-tools
- Language: JavaScript
- Homepage:
- Size: 65.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# service virtualization using mountebank
### getting started
```bash
git clone https://github.com/sadabnepal/mountebank-api-mock.git &&
cd mountebank-api-mock
```
### pre-requisite
[](https://nodejs.org/en/download/)
### install package
```
npm install
```
### start stub
```
npm start
```
### stub details
The project is using [mountebank](http://www.mbtest.org) as a service virtualization tool, which provides following endpoints.
```
Base URL: http://localhost:4545/api
```
| http call | endpoint | status code | payload |
|-------------|------------------------|-------------|-----------|
| GET | `/users/{id}` | 200 | N/A |
| GET | `/users?page={number}` | 200 | N/A |
| POST | `/users` | 201 | `{"name": "sadab", "job": "tester" }`|
| PUT | `/users/{id}` | 200 | `{"name": "saqib", "job": "admin" }` |
| POST | `/register` | 200 | `{"email": "test@test.com", "password": "test@123" }` |
| POST | `/login` | 200 | `{"email": "test@test.com", "password": "test@123" }` |
Note: default response will be empty object `{}` with response code: `404`
Other Mocking libraries:
- https://mswjs.io/
- https://github.com/nock/nock