
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
profiled-mock-api
Advanced tools
This is a server built on top of [express](https://www.npmjs.com/package/express) which serves JSON and XML files based on file/folder configuration. The root directory of the response files can be separated by "profiles."
This is a server built on top of express which serves JSON and XML files based on file/folder configuration. The root directory of the response files can be separated by "profiles."
One can create a new index.ts
file and fill it with contents:
import { MockApiServer, GlobalLogger, LogLevel } from 'profiled-mock-api'
GlobalLogger.getInstance().logLevel = LogLevel.ALL
const mockServer: MockApiServer = new MockApiServer({
initialActiveProfile: "default", // default: 'default'
port: 3000, // default 3000
profileDirectory: "responses"
})
mockServer.start()
With file structure:
node_modules
responses
default
ping.json
index.ts
package.json
we can create ping.json:
{
"message": "pong"
}
responses
is where the profile directories will be stored. responses/default
is the root directory where responses of the "default" profile will be served from.
ts-node index.ts
GET http://localhost:3000/ping
Directory Structure:
resources
default
ping.json
some
deep
path
status.json
Calls:
Directory Structure:
resources
default
ping.GET.json
ping.POST.json
some
deep
path
status.GET.json
status.PUT.json
Calls:
Directory Structure:
resources
default
ping.GET.200.json
ping.POST.500.json
some
deep
path
status.GET.200.json
status.PUT.201.json
health
check.500.json
Calls:
Directory Structure:
resources
default
ping
GET.json
POST.json
health
check
GET.json
POST.201.json
PUT.500.json
Calls:
Suppose we have a directory structure as follows:
resources
test_case_happy_path
ping
GET.200.json
health
check
GET.200.json
test_case_evtang_broken
ping
GET.500.json
health
check
GET.500.json
Profiles can be seen at
GET http://localhost:3000/profiles
:
{
"test_case_happy_path": {
"responseFileBasePath": "responses\\test_case_happy_path"
},
"test_case_evtang_broken": {
"responseFileBasePath": "responses\\test_case_evtang_broken"
}
}
The active profile can be seen at
GET http://localhost:3000/activeProfile
:
{
"activeProfile": "test_case_happy_path"
}
The active profile can be seen at
POST http://localhost:3000/activeProfile
:
with body
{
"newlyActiveProfile": "test_case_happy_path"
}
Response 200: {
}
FAQs
This is a server built on top of [express](https://www.npmjs.com/package/express) which serves JSON and XML files based on file/folder configuration. The root directory of the response files can be separated by "profiles."
The npm package profiled-mock-api receives a total of 0 weekly downloads. As such, profiled-mock-api popularity was classified as not popular.
We found that profiled-mock-api 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.