
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@ashvajs/mock-server
Advanced tools
[](https://www.npmjs.com/package/@ashvajs/mock-server) [](https://www.npmjs.com/package/@ashvajs/mock-server)
Simple mock server to serve static/dynamic routes for mock api.
Create your mock server object with mock server class and pass express app object with folder path.
mocks
..api
....v1
......product
........[product] // serves /api/v1/product/[apple|etc|string]/list-items
.........list-items
............get.json // serves /api/v1/product/[apple|etc|string]/list-items [get method]
.........post.json // serves /api/v1/product/[apple|etc|string] [post method]
......test // route
........post.json // serves as /api/v1/test [post method]
........get.json // serves as /api/v1/test [get method]
........delete.json // serves as /api/v1/test [delete method]
........patch.json // serves as /api/v1/test [patch method]
......dynamic // route
........post // for dynamic routes
..........index.js
........get
..........index.js
module.exports = (req, res, options) => {
// options.params to access url parameters
// e.g. route is /api/v1/product/[productid]
// if call is done for /api/v1/product/prod-149
// options.params.productid -> prod-149
//write your business logic
return {
message: 'js response example',
};
};
import path from 'path';
import express from 'express';
import { MockServer } from '@ashvajs/mock-server';
const host = process.env.HOST ?? 'localhost';
const port = process.env.PORT ? Number(process.env.PORT) : 3000;
const app = express();
const mockserver = new MockServer(
{
staticMocks: '/api/*', // or *|custom pattern
staticApiPath: path.resolve('apps/mock-server-example/mocks'),
},
app
);
mockserver.init();
app.listen(port, host, () => {
console.log(`[ ready ] http://${host}:${port}`);
});
const path = require('path');
const express = require('express');
const { MockServer } = require('@ashvajs/mock-server');
const host = process.env.HOST ?? 'localhost';
const port = process.env.PORT ? Number(process.env.PORT) : 3000;
const app = express();
const mockserver = new MockServer(
{
staticMocks: '/api/*', // or *|custom pattern
staticApiPath: path.resolve('apps/mock-server-example/mocks'),
},
app
);
mockserver.init();
app.listen(port, host, () => {
console.log(`[ ready ] http://${host}:${port}`);
});
see apps/mock-server-example
FAQs
[](https://www.npmjs.com/package/@ashvajs/mock-server) [](https://www.npmjs.com/package/@ashvajs/mock-server)
The npm package @ashvajs/mock-server receives a total of 1 weekly downloads. As such, @ashvajs/mock-server popularity was classified as not popular.
We found that @ashvajs/mock-server 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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.