{"id":15046940,"url":"https://github.com/kitabisa/smockr","last_synced_at":"2026-03-06T07:01:33.846Z","repository":{"id":235436909,"uuid":"774030837","full_name":"kitabisa/smockr","owner":"kitabisa","description":"Supple mock server with flexible on-demand response and optional get random fake data using Faker.js","archived":false,"fork":false,"pushed_at":"2026-03-04T19:13:08.000Z","size":633,"stargazers_count":2,"open_issues_count":11,"forks_count":0,"subscribers_count":10,"default_branch":"main","last_synced_at":"2026-03-05T01:33:20.014Z","etag":null,"topics":["backend","bun","cli","frontend","mock","mocking","tools"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/@kitabisa/smockr","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kitabisa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-18T20:27:39.000Z","updated_at":"2026-03-04T19:11:46.000Z","dependencies_parsed_at":"2025-12-03T17:01:31.233Z","dependency_job_id":null,"html_url":"https://github.com/kitabisa/smockr","commit_stats":{"total_commits":178,"total_committers":7,"mean_commits":"25.428571428571427","dds":0.5,"last_synced_commit":"23988c9505051ddcc922be96d59c7a82c0390a48"},"previous_names":["kitabisa/smockr"],"tags_count":60,"template":false,"template_full_name":null,"purl":"pkg:github/kitabisa/smockr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitabisa%2Fsmockr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitabisa%2Fsmockr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitabisa%2Fsmockr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitabisa%2Fsmockr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kitabisa","download_url":"https://codeload.github.com/kitabisa/smockr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitabisa%2Fsmockr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30164884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T04:43:31.446Z","status":"ssl_error","status_checked_at":"2026-03-06T04:40:30.133Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["backend","bun","cli","frontend","mock","mocking","tools"],"created_at":"2024-09-24T20:53:47.171Z","updated_at":"2026-03-06T07:01:33.805Z","avatar_url":"https://github.com/kitabisa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://kitabisa.com\"\u003e\n    \u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/kitabisa/smockr/main/.github/assets/logo-dark.svg\"\u003e\u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/kitabisa/smockr/main/.github/assets/logo-light.svg\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/kitabisa/smockr/main/.github/assets/logo-light.svg\" alt=\"smockr\" width=\"350\" height=\"70\"\u003e\u003c/picture\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  Supple mock server with flexible on-demand response and optional get random fake data using \u003ca href=\"https://github.com/faker-js/faker\"\u003eFaker.js\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/kitabisa/smockr/actions/workflows/ci.yaml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/kitabisa/smockr/ci.yaml?branch=main\" alt=\"Build Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@kitabisa/smockr\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/@kitabisa/smockr.svg\" alt=\"NPM Downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://hub.docker.com/r/kitabisa/smockr\"\u003e\u003cimg src=\"https://img.shields.io/docker/pulls/kitabisa/smockr\" alt=\"Docker Pull\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/kitabisa/smockr/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/kitabisa/smockr\" alt=\"Latest Release\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/kitabisa/smockr/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/@kitabisa/smockr.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n------\n\n## Features\n\n * Using [Bun](https://github.com/oven-sh/bun)\n * Written in [Typescript](https://github.com/microsoft/TypeScript)\n * Flexible on-demand response (can modify body, status, headers, and delayed response)\n * Optional get random fake data using [Faker.js](https://github.com/faker-js/faker)\n * Request body validation using [JSON Schema](https://json-schema.org/learn/miscellaneous-examples)\n * No data storage needed\n\n## Getting Started\n\nSetup smockr with npm\n\n```\n$ npm install -g @kitabisa/smockr\n```\n\nSetup smockr with bun\n\n```\n$ bun add -g @kitabisa/smockr\n```\n\nSetup smockr with docker\n\n```\n$ docker pull kitabisa/smockr\n```\n\n## Quick Start\n\n### Run with node or bun\n\nRunning mock with default params\n\n```\n$ smockr\n```\n\nRunning mock with custom params\n\n```\n$ smockr \\\n--port 3000 \\\n--secret \"mysecret\" \\\n--allowOrigin \"https://kitabisa.com\" \\\n--allowMethods \"GET, POST, PATCH\" \\\n--allowHeaders \"Content-Type, Authorization\"\n```\nWhen you define `secret` as a parameter and is not empty string, the client request must be include `X-Smockr-Secret` header with the same value\n\nSee a list of all available options\n\n```\n$ smockr --help\n```\n\nSee a installed version\n\n```\n$ smockr --version\n```\n\n### Run with docker\n\nRunning mock with default params\n\n```\n$ docker run -p 8080:8080 --rm \\\nkitabisa/smockr\n```\n\nRunning mock with custom params\n\n```\n$ docker run -p 3000:8080 --rm \\\n-e SECRET_KEY=\"mysecret\" \\\n-e ALLOWED_ORIGIN=\"https://kitabisa.com\" \\\n-e ALLOWED_METHODS=\"GET, POST, PATCH\" \\\n-e ALLOWED_HEADERS=\"Content-Type, Authorization\" \\\nkitabisa/smockr\n```\n\n## Usage\n\n### Body\n\nSpecify a search body param to retrieve a response with that body.\n\n```http\nGET http://localhost:8080/?mock[response][body]={\"ping\":\"pong\"}\n\n\nHTTP/1.1 200 OK\ncontent-type: application/json\ncontent-length: 18\n\n{\n  \"ping\": \"pong\"\n}\n```\n\nSpecify a search body param with random fake data using [faker.js api helpers fake](https://fakerjs.dev/api/helpers#fake).\n\n```http\nGET http://localhost:8080/?mock[response][body]={\"id\":{{number.int({\"min\":100000,\"max\":900000})}},\"name\":\"{{person.fullName}}\",\"avatar\":\"{{image.avatar}}\"}\n\n\nHTTP/1.1 200 OK\ncontent-type: application/json\ncontent-length: 107\n\n{\n  \"id\": 429178,\n  \"name\": \"Allen Brown\",\n  \"avatar\": \"https://avatars.githubusercontent.com/u/97165289\"\n}\n```\n\n### Status\n\nSpecify a search status param get back that code status. The status must be\ninside the range 200 to 599.\n\n```http\nGET http://localhost:8080/?mock[response][status]=301\n\n\nHTTP/1.1 301 Moved Permanently\ncontent-type: application/json\ncontent-length: 0\n```\n\n### Headers\n\nSpecify a search headers param as json string to get them back.\n\n```http\nGET http://localhost:8080/?mock[response][headers]={\"x-hello\":\"world\"}\n\n\nHTTP/1.1 200 OK\ncontent-type: application/json\ncontent-length: 0\nx-hello: world\n```\n\n### Delay\n\nSpecify a search delay param in milliseconds in order to delay the response.\n\n```http\nGET http://localhost:8080/?mock[response][delay]=3000\n\n\nHTTP/1.1 200 OK\ncontent-type: application/json\ncontent-length: 0\n```\n\n### Schema Validation\n\nSpecify a search schema validation in json schema (stringify) to set request body validation.\n\n```http\nPOST http://localhost:8080/?mock[request][body][schema]={\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"age\":{\"type\":\"integer\",\"minimum\":17}},\"required\":[\"name\"]}\n\n{\n  \"age\": 20\n}\n\n\nHTTP/1.1 400 Bad Request\ncontent-type: application/json\ncontent-length: 84\n\n{\n  \"code\": 400,\n  \"message\": \"Requires property name\",\n  \"type\": \"SchemaValidationException\"\n}\n```\n\n### Health check\n\nPredefined health check route.\n\n```http\nGET http://localhost:8080/health-check\n\n\nHTTP/1.1 200 OK\ncontent-type: application/json\ncontent-length: 24\n\n{\n  \"health_check\": \"up\"\n}\n```\n\n## Caveats\n\nSome cases in production server, there may be problems related to `Request-URI too large`. If you are using kubernetes ingress, try to apply this configuration:\n```yml\nannotations:\n  nginx.ingress.kubernetes.io/client-header-buffer-size: 100k\n  nginx.ingress.kubernetes.io/large-client-header-buffers: 4 100k\n  nginx.ingress.kubernetes.io/server-snippet: |\n    client_header_buffer_size 100k;\n    large_client_header_buffers 4 100k;\n```\n\n\n## Contributing\n\nWant to contribute? Awesome! You can find information about contributing to\nthis project in the [CONTRIBUTING.md](https://github.com/kitabisa/smockr/blob/main/CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitabisa%2Fsmockr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitabisa%2Fsmockr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitabisa%2Fsmockr/lists"}