{"id":13447756,"url":"https://github.com/NaturalIntelligence/Stubmatic","last_synced_at":"2025-03-22T01:31:16.664Z","repository":{"id":15090890,"uuid":"77529633","full_name":"NaturalIntelligence/Stubmatic","owner":"NaturalIntelligence","description":"Mock HTTP calls without coding. Designed specially for testing and testers.","archived":false,"fork":false,"pushed_at":"2024-03-21T13:53:47.000Z","size":808,"stargazers_count":130,"open_issues_count":20,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-01T11:46:42.902Z","etag":null,"topics":["fake","http","https","mock","nodejs","proxy","rest","simulator","soap","soap-services","soap-web-services","ssl","stub","stub-server","tcp","validate"],"latest_commit_sha":null,"homepage":"https://naturalintelligence.github.io/Stubmatic/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NaturalIntelligence.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-28T11:58:09.000Z","updated_at":"2024-07-31T05:53:31.652Z","dependencies_parsed_at":"2023-10-15T03:16:23.730Z","dependency_job_id":"e650f0dc-6cae-438b-a806-66d7d9e13d27","html_url":"https://github.com/NaturalIntelligence/Stubmatic","commit_stats":{"total_commits":313,"total_committers":7,"mean_commits":"44.714285714285715","dds":0.207667731629393,"last_synced_commit":"bcaf19d5140fcc29f1afea698041620a87bb525e"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2FStubmatic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2FStubmatic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2FStubmatic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaturalIntelligence%2FStubmatic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NaturalIntelligence","download_url":"https://codeload.github.com/NaturalIntelligence/Stubmatic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244893435,"owners_count":20527591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fake","http","https","mock","nodejs","proxy","rest","simulator","soap","soap-services","soap-web-services","ssl","stub","stub-server","tcp","validate"],"created_at":"2024-07-31T05:01:26.127Z","updated_at":"2025-03-22T01:31:16.111Z","avatar_url":"https://github.com/NaturalIntelligence.png","language":"JavaScript","readme":"# Stubmatic\nMock HTTP calls without coding. Designed specially for testing and testers.\n\n[![NPM quality][quality-image]][quality-url]\n[![Travis ci Build Status](https://travis-ci.org/NaturalIntelligence/Stubmatic.svg?branch=master)](https://travis-ci.org/NaturalIntelligence/Stubmatic) \n[![Gitter](https://img.shields.io/gitter/room/Stubmatic/Stubmatic.svg)](https://gitter.im/Stubmatic/Lobby#) \n[![Known Vulnerabilities](https://snyk.io/test/github/naturalintelligence/stubmatic/badge.svg)](https://snyk.io/test/github/naturalintelligence/stubmatic) \n[![Coverage Status](https://coveralls.io/repos/github/NaturalIntelligence/Stubmatic/badge.svg?branch=dev)](https://coveralls.io/github/NaturalIntelligence/Stubmatic?branch=dev)\n\n\n\u003ca href=\"https://opencollective.com/stubmatic/donate\" target=\"_blank\"\u003e\n  \u003cimg src=\"https://opencollective.com/stubmatic/donate/button@2x.png?color=blue\" width=200 /\u003e\n\u003c/a\u003e\n\u003ca href=\"https://paypal.me/naturalintelligence\"\u003e \u003cimg src=\"static/img/support_paypal.svg\" alt=\"Stubmatic donate button\" width=\"200\"/\u003e\u003c/a\u003e\n\n\n\n[quality-image]: http://npm.packagequality.com/shield/stubmatic.svg?style=flat-square\n[quality-url]: http://packagequality.com/#?package=stubmatic\n\n\n\u003cimg align=\"right\" src=\"https://naturalintelligence.github.io/Stubmatic/img/stubmatic_logo.png?raw=true\" width=\"180px\" alt=\"Stubmatic logo\"/\u003e \n\n1. Installation : `$npm install stubmatic -g`\n2. Set up repo  : `$stubmatic init [repo-name]`\n3. Start server : `$stubmatic [-d \u003crepo-name\u003e]`\n4. Help         : `$stubmatic --help`\n\nImportant links : [Video Tutorial](https://youtu.be/7mA4-MXxwgk), [Wiki](https://github.com/NaturalIntelligence/Stubmatic/wiki), [NPM](https://www.npmjs.com/package/stubmatic), [Demo](https://github.com/NaturalIntelligence/Stubmatic/tree/master/functional-tests) application, [issues](https://github.com/NaturalIntelligence/Stubmatic/issues), [changelogs](https://github.com/NaturalIntelligence/Stubmatic/wikiChangelog)\n[\u003cimg width=\"180px\" src=\"https://naturalintelligence.github.io/Stubmatic/img/showcase_btn.png\" alt=\"Stubmatic donate button\"/\u003e](https://naturalintelligence.github.io/Stubmatic/#showcase)\n\n## Users\n\u003ca href=\"https://o2.co.uk/\" title=\"Telefonica O2 UK\" \u003e \u003cimg src=\"https://avatars0.githubusercontent.com/u/2110471\" width=\"80px\" \u003e\u003c/a\u003e\n\n## Main features\n\n* Mock HTTP(s) calls. (Hence can mock REST/SOAP web services)\n* Inspect HTTP calls from CLI or log them for more detail.\n* No code. Designed specially for testing and testers.\n* Mock messagepack or Nimn (निम्न) response easily. Write in JSON parse in desirable format. \n* Support SSL certificates.\n* Optional configuration\n* Dynamic response\n  * Use Regular Expressions to match a request, capture some part of the request, to decide response file at runtime, to change contents of response at runtime etc. \n  * Use **Expressions** (functions and markers) to display dynamic dates, random number etc.\n  * Devide your response into multiple files (called **dumps**) for readability, reusability, and consistency.\n  * Create a response skeleton with **DB sets** and fill data as per matched request.\n  * Delay response for fixed or random time.\n* Send response as a stream (downloadable file)\n* Compress response automatically.\n* Route requests to other server using **proxy**.\n* Memory and CPU efficient\n* Ready to be used in performance environment\n* And much more like short notations, multiple mapping files, file strategy etc.\n\n## Configuration\nTo install stubmatic, you need to install [nodejs](https://nodejs.org/en/download/) and npm first. It is recommanded to be on latest version of both. npm is bundeled with nodejs. Now follow above commands to install stubmatic and to set up a repo.\n\n## How to start\nStubmatic works on request response mappings specified in a yaml file. Response contents can be read from *body* or *file* attribute of a maping. \n\n```yaml\n-  request:\n      url: /stubs/(admin|staff|customer|security)/([0-9]+)/2\n\n   response:\n      body: \u003e\n        multiple line response\n        another line\n```\nWhen a request reaches to stubmatic server, it matches the request against all mappings. Whichever mapping matches first(top to bottom), will be used to serve the response. A complete response can be built with multiple files. It can also have some placeholder to show dynamic data, like date, or some random number or some part from request itself. Stubmatic first process and build complete response then respond back to any HTTP(s) request.\n\nUsing regular expression, single mapping can be used to match multiple requests and serve response from different files.\n\n#### Sample SOAP request mapping\n```yaml\n-  request:\n     method: POST\n     url: /soap-simulator/services/ServiceName\n     post: actionName[\\s\\S]*mobile.([0-9]+)\n  response:\n     headers:\n           content-type: text/xml\n     strategy: \"first-found\"\n     files: [\"stubs/\u003c% post.1 %\u003e/response.xml\",\"stubs/ServiceName/actionName/default.xml\"]\n```\n#### Sample REST request mapping\n```yaml\n-  request:\n     method: GET\n     url: /rest-simulator/services/ServiceName/actionName/([0-9]+)\n  response:\n     headers:\n           content-type: text/xml\n     strategy: \"first-found\"\n     files: [\"stubs/\u003c% url.1 %\u003e/response.xml\",\"stubs/ServiceName/actionName/default.xml\"]\n```\n\n\n## Our other projects and research you must try\n\n* **[BigBit standard](https://github.com/amitguptagwl/bigbit)** : \n  * Single text encoding to replace UTF-8, UTF-16, UTF-32 and more with less memory.\n  * Single Numeric datatype alternative of integer, float, double, long, decimal and more without precision loss.\n* **[Cytorus](https://github.com/NaturalIntelligence/cytorus)**: Now be specific and flexible while running E2E tests.\n  * Run tests only for a particular User Story\n  * Run tests for a route or from a route\n  * Customizable reporting\n  * Central dashboard for better monitoring\n- **[imglab](https://github.com/NaturalIntelligence/imglab)** : Web based tool to label images for object. So that they can be used to train dlib or other object detectors. You can integrate 3rd party libraries for fast labeling.\n\n## Supporters\n### Contributors\n\nThis project exists thanks to [all](graphs/contributors) the people who contribute. [[Contribute](docs/CONTRIBUTING.md)].\n\n\u003ca href=\"graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/stubmatic/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n### Backers\n\nThank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/stubmatic#backer)]\n\n\u003ca href=\"https://opencollective.com/stubmatic#backers\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/stubmatic/backers.svg?width=890\"\u003e\u003c/a\u003e\n\n### Sponsors\n\n\u003csmall\u003e[[Become a sponsor](https://opencollective.com/stubmatic#sponsor)] Support this project by becoming a sponsor. Your logo will show up here with a link to your website. Please also share your detail so we can thankyou on SocialMedia.\u003c/small\u003e\n\n\u003ca href=\"https://opencollective.com/stubmatic/sponsor/0/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/stubmatic/sponsor/0/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/stubmatic/sponsor/1/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/stubmatic/sponsor/1/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/stubmatic/sponsor/2/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/stubmatic/sponsor/2/avatar.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencollective.com/stubmatic/sponsor/3/website\" target=\"_blank\"\u003e\u003cimg src=\"https://opencollective.com/stubmatic/sponsor/3/avatar.svg\"\u003e\u003c/a\u003e\n\n### Helpful articles and tutorials\n\n- [Clean \u0026 quick way to create simulators](https://dzone.com/articles/stubby-db-clean-amp-quick-way-to-create-simulators)\n- [Stubby4j to Stubmatic](https://medium.com/@amitgupta.gwl/stubby4j-to-stubmatic-a1c8b54d4758)\n- [How to setup stubmatic project and stub SOAP webservices](https://naturalintelligence.github.io/Stubmatic/#exampleModal1)\n- [How to delay response and stub RESTful webservices](https://naturalintelligence.github.io/Stubmatic/#exampleModal2)\n- [How to route response to other servers](https://naturalintelligence.github.io/Stubmatic/#proxymodal)\n- [How to make dynamic response with data sets, and expressions](https://naturalintelligence.github.io/Stubmatic/#exampleModal5)\n- [How to break a response file into multiple files using dumps](https://naturalintelligence.github.io/Stubmatic/#exampleModal6)\n\n\n","funding_links":["https://opencollective.com/stubmatic/donate","https://paypal.me/naturalintelligence","https://opencollective.com/stubmatic"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNaturalIntelligence%2FStubmatic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNaturalIntelligence%2FStubmatic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNaturalIntelligence%2FStubmatic/lists"}