{"id":15723370,"url":"https://github.com/doannc2212/stub","last_synced_at":"2026-01-20T19:32:06.777Z","repository":{"id":219229157,"uuid":"748477469","full_name":"doannc2212/stub","owner":"doannc2212","description":"An application for create custom response","archived":false,"fork":false,"pushed_at":"2025-11-18T23:52:59.000Z","size":78,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-19T01:20:00.916Z","etag":null,"topics":["api","elysiajs","honojs","mock","redis","rest","rest-api","stub-api","testing","testing-tools"],"latest_commit_sha":null,"homepage":"","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/doannc2212.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-26T03:41:31.000Z","updated_at":"2024-12-13T06:25:10.000Z","dependencies_parsed_at":"2024-01-26T07:28:04.388Z","dependency_job_id":"c27e779f-2aa3-4c0e-9537-25a97f9cc28e","html_url":"https://github.com/doannc2212/stub","commit_stats":null,"previous_names":["doannc2212/stub"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/doannc2212/stub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doannc2212%2Fstub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doannc2212%2Fstub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doannc2212%2Fstub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doannc2212%2Fstub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doannc2212","download_url":"https://codeload.github.com/doannc2212/stub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doannc2212%2Fstub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28610608,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"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":["api","elysiajs","honojs","mock","redis","rest","rest-api","stub-api","testing","testing-tools"],"created_at":"2024-10-03T22:11:21.378Z","updated_at":"2026-01-20T19:32:06.762Z","avatar_url":"https://github.com/doannc2212.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stub API\nAn application for create placeholder implementation of API responses which used as temporary substitute for the actual API.\nBuild with Hono and redis. Checkout elysia for elysia stuff\n\n## Installation\nFirstly, clone this repository\n```\ngit clone https://github.com/doannc2212/stub.git\n```\n1. Run with bun\n```\ncd stub\nbun install\nbun run dev\n```\n2. Run with Docker\n```\ndocker compose up -d\n```\nThen,\n```\nStub is up on http://localhost:8000\n```\n\n## How to use?\nYou need to attach cookie `userId=${value}` when request for api to know which user need data\n\n1. Create a new mock response \u003cbr\u003e\nSend a request to stub endpoint\n```js\nPOST baseUrl/create\nCookie: userId=john\n{\n\t// request method\n\t\"method\": \"GET\",\n\t// requset path, which place right after baseUrl/api/\n\t\"path\": \"/sample\",\n\t// response body\n\t\"data\": {\n\t\t\"id\": 1,\n\t\t\"name\": \"John Doe\"\n\t},\n\t// response status\n\t\"status\": 200\n}\n```\n\n2. Clear mock response\n```js\nPOST baseUrl/clear\nCookie: userId=john\n```\n\n3. Retrieve mock data \u003cbr/\u003e\nSend request to `baseUrl/api/` + `path` which you create before\n\n*Request*:\n```js\nGET baseUrl/api/sample\nCookie: userId=john\n```\nResponse:\n```js\n{\n\t\"id\": 1,\n\t\"name\": \"John Doe\"\n}\n```\n\n## FAQ\n\n### Stub api is not work after apply to my web application?\n\nThe stub API relies on cookies. To resolve this, follow these steps:\n\n1. Open Chrome DevTools.\n2. Navigate to the \"Application\" tab.\n3. Locate the cookies associated with your stub API endpoint.\n4. Set the \"Same-Site\" attribute of that cookies to \"None\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoannc2212%2Fstub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoannc2212%2Fstub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoannc2212%2Fstub/lists"}