{"id":18459832,"url":"https://github.com/sayjava/deputy","last_synced_at":"2025-04-08T06:31:52.532Z","repository":{"id":37746998,"uuid":"409550246","full_name":"sayjava/deputy","owner":"sayjava","description":"http mocking, assert and proxy server for development and testing","archived":false,"fork":false,"pushed_at":"2022-10-12T14:35:14.000Z","size":6819,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T07:22:50.049Z","etag":null,"topics":["api-mock","http-mock","http-stub","mock-server","mocking-server","stubbing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sayjava.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-23T10:43:16.000Z","updated_at":"2022-06-10T15:19:52.000Z","dependencies_parsed_at":"2023-01-19T13:03:18.911Z","dependency_job_id":null,"html_url":"https://github.com/sayjava/deputy","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayjava%2Fdeputy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayjava%2Fdeputy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayjava%2Fdeputy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sayjava%2Fdeputy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sayjava","download_url":"https://codeload.github.com/sayjava/deputy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247792046,"owners_count":20996876,"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":["api-mock","http-mock","http-stub","mock-server","mocking-server","stubbing"],"created_at":"2024-11-06T08:24:37.205Z","updated_at":"2025-04-08T06:31:51.304Z","avatar_url":"https://github.com/sayjava.png","language":"TypeScript","readme":" \u003ch1 align=\"center\"\u003eDeputy\u003c/h1\u003e\n \u003cp align=\"center\"\u003e\n  \u003cimg src=\"ui/src/logo.svg\" width=\"150\"\u003e\n \u003c/p\u003e\n \u003cp align=\"center\"\u003e\nThe easiest and quickest way to mock HTTP endpoints for development and testing purposes\n \u003c/p\u003e\n \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://sayjava.github.io/deputy/\"\u003e\u003cstrong\u003eExplore deputy docs »\u003c/strong\u003e\u003c/a\u003e\n \u003c/p\u003e\n \u003cp align=\"center\"\u003e\n  \u003ca href=\"https://sayjava.github.io/deputy/start\"\u003eQuick Start »\u003c/a\u003e\n  \u003ca href=\"https://sayjava.github.io/deputy/guide\"\u003eGuide »\u003c/a\u003e\n  \u003ca href=\"https://sayjava.github.io/deputy/api\"\u003eAPI »\u003c/a\u003e\n \u003c/p\u003e\n \u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/sayjava/deputy/workflows/Build/badge.svg\" /\u003e\n  \u003cimg src=\"https://github.com/sayjava/deputy/workflows/Docs/badge.svg\" /\u003e\n  \u003cimg src=\"https://github.com/sayjava/deputy/workflows/Release/badge.svg\" /\u003e\n \u003c/p\u003e\n\n# What is Deputy?\n\nDeputy is an HTTP API mocking server that can aid in rapid application development by mocking endpoints and configuring responses from configurations.\n\nDeputy can also act as a testing server to validate what requests made by system under test.\n\n![Dev](./docs/static/landing.png)\n\nHere is a sample mock definition\n\n```json\n[\n    {\n        \"request\": {\n            \"path\": \"/user/(\\\\d+)/slug/(.*)\",\n            \"params\": {\n                \"output_type\": \"json|xml\"\n            }\n        },\n        \"response\": {\n            \"status\": 200,\n            \"headers\": {\n                \"Content-Type\": \"application/json\"\n            },\n            \"body\": [\n                {\n                    \"id\": \"slug-id\",\n                    \"content\": \"The post content\"\n                }\n            ]\n        }\n    }\n]\n```\n\n## Quick Start\n\nWith nodejs\n\n```shell\nnpx @sayjava/deputy\n```\n\nWith docker\n\n```shell\ndocker run -p 8080:8080 -p 8081:8081 ghcr.io/sayjava/deputy\n```\n\nand test a sample endpoint\n\n```shell\ncurl http://localhost:8080/who-am-i\n```\n\n## Features\n\n-   [Declarative request matching and response](https://sayjava.github.io/deputy/guide)\n-   [Regex based request matching](https://sayjava.github.io/deputy/guide) (request path, headers and body matchers)\n-   [Alternate and limit responses on same request](https://sayjava.github.io/deputy/guide)\n-   [HTTP request validations](https://sayjava.github.io/deputy/assertions)\n-   [Simulate response delays and network failures](https://sayjava.github.io/deputy/guide)\n-   [Inspect HTTP Requests and Response in realtime](https://sayjava.github.io/deputy/start)\n\n## Examples\n\n-   [with-nextjs-commerce](examples/with-nextjs-commerce)\n-   [with-nextjs-middleware](examples/with-nextjs-commerce)\n\n## Programitcally\n\n```javascript\nconst express = require('express');\nconst { createExpressMiddleware } = require('@sayjava/deputy');\n\n// mount the mock on a middleware endpoint\nconst app = express();\napp.use('/api', createExpressMiddleware({ mocksFolder: 'fixtures' }));\napp.listen(3000, () =\u003e console.log('server started'));\n```\n\n## Usage Scenarios\n\nHere are some setup scenarios that deputy can be used to aid development and testing\n\n### Transparently Mock \u0026 Forward API requests\n\nSimulate unready APIs by mocking some APIs and have other requests transparently forwarded to remote APIs\nSee the examples/commerce folder using that uses the [next/commerce](next/commerces) + deputy\n\n![Dev](./docs/static/dev_environment.png)\n\n### Application Testing\n\nSimulate complex HTTP requests and response scenarios in test environments\n\n![Test](./docs/static/test_environment.png)\n\nsee the [Mock Guide](http://sayjava.github.io/deputy/mocking)\n\n## Deputy UI\n\nBy default, Deputy server can be reached at `http://localhost:8081`.\n\n### Logs View\n\nView and inspect http requests and responses from the Logs interface in realtime as requests are received\n\n![Logs](./docs/static/logs.png)\n\n### Visualize\n\nDeputy automatically creates a sequence diagram of requests it receives\n\n![Visualize](./docs/static/visualize.png)\n\n### Mocking Interface\n\nMocks can be imported, exported, edited, cloned, disabled, and enabled from Deputy UI\n\n![Mocking Interface](./docs/static/mock_management.png)\n\n### Full Documentation\n\n[Full Documentation](https://sayjava.github.io/deputy)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsayjava%2Fdeputy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsayjava%2Fdeputy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsayjava%2Fdeputy/lists"}