Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@manageiq/manageiq-api-mock
Advanced tools
If you don't plan on doing doing development for Mock API and would just like to use what has been developed, please run
npm install -g @manageiq/manageiq-api-mock
or yarn global add @manageiq/manageiq-api-mock
Download this git repository and run
npm install
or yarn install
If you installed this NPM package globally then you can run it anywhere on the command line by running mockapi
(By default it runs on port 3004). If you want to change ports or view available CLI options , run mockapi -h
If you want to include this node module in your project install it as you would any other dependency like
yarn add @manageiq/manageiq-api-mock
If you want to start Mock API from your package.json "scripts" section. Here is a snippet that makes that possible
"scripts": {
"start:mock-api": "cd node_modules/manageiq-api-mock/ && node index.js"
}
Then when in your projects directory you can then start mock api by running yarn start:mock-api
or npm start:mock-api
If you would like to get this to run on a different port , please set the following environmental variable
export MOCK_API_HOST=localhost:3005
or whatever port you would like.
If you would like to debug incoming http requests please set the following environmental variable
export LOG_LEVEL=debug
If you look at the root of the project you will see a folder named data that contains subfolders that have .json files.
If you want to add a new restful endpoint or edit an existing endpoint create a file with the following naming conventionunique_filename.json
Below you will see a sample of what one of the files looks like
{
"url":"blueprints",
"get":{"test":"test"},
"put":{},
"post":{},
"delete":{}
}
Key Elements in configuration
Sometimes you will have urls with querystrings you need to handle like http://localhost:3000/api/blueprints?test=123
You also might end up with urls with subpaths like http://localhost:3000/api/blueprints/test/path/
The Mock API handles defining both of these scenarios the same way.
For example querystrings
{
"url":"blueprints?test=123",
"get":{"test":"test"}
}
or subpaths
{
"url":"blueprints/test/path/",
"get":{"test":"test"}
}
If you would like to override any of the endpoints in the repo please drop the overriden files into the /local directory structure. This will pick up and override files that match from stock data.
Please see CONTRIBUTING.md for more details on how to contribute to this repo.
This repo utilizes Semantic release versioning. Please refer to Semantic Release documentation or our CONTRIBUTING.md to learn more about how version changelogs and versions are auto generated. To view the most up to date version changelog, please refer to Releases
FAQs
Mock REST API for ManageIQ
The npm package @manageiq/manageiq-api-mock receives a total of 2 weekly downloads. As such, @manageiq/manageiq-api-mock popularity was classified as not popular.
We found that @manageiq/manageiq-api-mock demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.