
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@draganfilipovic/mocker
Advanced tools
Simple Node.js mock server with GUI for managing API endpoints and responses
Simple Node.js mock server with a beautiful GUI for managing API endpoints and responses. Perfect for development, testing, and prototyping.

/users/{id}/postsnpm install -g @draganfilipovic/mocker
npm install @draganfilipovic/mocker
# Start the server (uses ./mocks directory by default)
mocker
# Or specify a custom directory
MOCKS_DIR=/path/to/your/mocks mocker
# Or set a custom port
PORT=8080 mocker
const mocker = require('@draganfilipovic/mocker');
// Start the server programmatically
mocker.start({
port: 3000,
mocksDir: './custom-mocks'
});
mocker [options]
Options:
-p, --port <number> Port to run the server on (default: 3000)
-d, --mocks-dir <path> Directory to store mock data (default: ./mocks)
-h, --help Show help message
# Set port and mocks directory
PORT=8080 MOCKS_DIR=./api-mocks mocker
# Default settings
mocker
# Custom port
mocker --port 8080
# or
PORT=8080 mocker
# Custom mocks directory
mocker --mocks-dir ./api-mocks
# or
MOCKS_DIR=./api-mocks mocker
# Both custom port and directory
mocker --port 8080 --mocks-dir ./api-mocks
# or
PORT=8080 MOCKS_DIR=./api-mocks mocker
The server automatically creates the following structure:
your-project/
├── mocks/ # Default mocks directory
│ └── endpoints/
│ ├── api/ # Static paths
│ │ └── users/
│ │ ├── get.200.Success.json
│ │ ├── get.404.Error.json
│ │ └── get.selected.json
│ └── users/ # Dynamic paths
│ └── __id__/ # {id} becomes __id__
│ └── posts/
│ ├── get.200.Success.json
│ └── get.selected.json
└── your-other-files...
ALL /your-endpoint-path - Returns the selected mock responseALL /users/{id}/posts - Dynamic paths with variable segments{param} syntaxFiles are named: {method}.{statusCode}.{name}.json
Example: get.200.Success.json
{
"message": "User retrieved successfully",
"data": {
"id": 1,
"name": "John Doe",
"email": "john@example.com"
}
}
Files are named: {method}.selected.json
Example: get.selected.json
{
"selectedResponseName": "Success"
}
Create flexible mock endpoints that handle variable URL segments using {param} syntax.
Basic Dynamic Path:
/users/{id}
Matches: /users/123, /users/456, /users/abc
Multiple Parameters:
/users/{userId}/posts/{postId}
Matches: /users/123/posts/456, /users/john/posts/my-post
Real-world Example:
/users/auth/email-exists/{email}
Matches: /users/auth/email-exists/test@example.com
/users/{id}/posts in the GUI{param} becomes __param__ in directory structure{param} segmentsIn the GUI:
With curl:
curl http://localhost:3000/users/123/posts
curl http://localhost:3000/users/456/posts
With JavaScript:
const response = await fetch('/users/123/posts');
const data = await response.json();
Path: /users/{id}/posts
Files: mocks/endpoints/users/__id__/posts/
- get.200.Success.json
- get.500.Error.json
- get.selected.json
git clone https://github.com/easingthemes/mocker.git
cd mocker
npm install
npm start
npm run build
This project is licensed under the MIT License - see the LICENSE file for details.
/users/{id}/posts{param} to __param__ conversionMade with ❤️ for developers who love clean, efficient mock servers.
(Actually made with Cursor AI)
FAQs
Simple Node.js mock server with GUI for managing API endpoints and responses
We found that @draganfilipovic/mocker 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
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.